This commit is contained in:
Yuri Zamyatin 2025-04-10 22:55:00 +00:00
parent 0168c5cefb
commit 3a8ad3022e
3 changed files with 19 additions and 3 deletions

View File

@ -1,6 +1,6 @@
[user]
email = yuri@yrz.am
name = Yuri Zamyatin
email = {{ .user.GIT_USER_EMAIL }}
name = {{ .user.GIT_USER_NAME }}
[init]
defaultBranch = main
[pull]

View File

@ -9,6 +9,21 @@ cd "$(dirname "$0")"
umask 002
[[ "$(id -u)" == "0" ]] && echo "ERROR: wrong user" >&1 && exit 1
########## init config #########
if [[ ! -f ~/.config/workspace.conf ]]; then
mkdir -p ~/.config
cp config/workspace.conf ~/.config
fi
while read -r line; do
param="${line::-1}"
if ! grep -qE "^$param=.+" ~/.config/workspace.conf; then
echo "ERROR: ~/.config/workspace.conf - missing $param"
CONFIG_INVALID=1
fi
done < config/workspace.conf
[[ $CONFIG_INVALID ]] && exit 1
################################
####### file structure #########
USER_DIRS=(
##### xdg #####
@ -46,7 +61,8 @@ gomplate --input-dir config \
--exclude-processing "!*.tmpl" \
--plugin jq=/bin/jq \
-c theme=config/theme.json \
-c user="$HOME/.workspace.conf"
-c user="file:///$HOME/.config/workspace.conf?type=application/x-env" \
--exclude /workspace.conf
ln -sf ~/.config/bash/bashrc ~/.bashrc
ln -sf ~/.config/profile ~/.profile