[colorschemes] rewrite the buildscript as a makefile

This commit is contained in:
Dmytro Meleshko 2020-09-06 14:14:29 +03:00
parent afb70a6ad3
commit 0442601626
12 changed files with 25 additions and 24 deletions

23
colorschemes/Makefile Normal file
View file

@ -0,0 +1,23 @@
# https://tech.davis-hansson.com/p/make/
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
.PHONY: all clean
OUT_DIR := out
OUT_FILES := iterm.itermcolors kitty.conf vim.vim setvtrgb.txt zsh.zsh termux.properties
all: $(OUT_DIR) $(addprefix $(OUT_DIR)/,$(OUT_FILES))
clean:
rm -rv out
out:
mkdir -p $@
$(OUT_DIR)/%: %.py
./$< > $@

View file

@ -1,22 +0,0 @@
#!/usr/bin/env bash
set -e
cd "$(dirname "${BASH_SOURCE[0]}")"
mkdir -p out
declare -A apps=(
[iterm]=itermcolors
[kitty]=conf
[nvim]=vim
[setvtrgb]=txt
[shell]=zsh
[termux]=properties
)
for app in "${!apps[@]}"; do
output_file="$app.${apps[$app]}"
echo "$output_file"
./"$app".py > ./out/"$output_file"
done

View file

@ -3,7 +3,7 @@
" Color definitions {{{
execute 'source' fnameescape(g:nvim_dotfiles_dir.'/../colorschemes/out/nvim.vim')
execute 'source' fnameescape(g:nvim_dotfiles_dir.'/../colorschemes/out/vim.vim')
if !&termguicolors && exists('$_COLORSCHEME_TERMINAL')
set notermguicolors

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# partially based on https://github.com/chriskempson/base16-shell/blob/master/templates/default.mustache
source "$ZSH_DOTFILES/../colorschemes/out/shell.zsh"
source "$ZSH_DOTFILES/../colorschemes/out/zsh.zsh"
if [[ -n "$TMUX" ]]; then
# tmux