init: v2 of dot

This commit is contained in:
Strix 2024-06-04 01:33:44 +02:00
parent 0a8b09ca65
commit 7991035935
13 changed files with 156 additions and 12 deletions

29
runner Executable file
View file

@ -0,0 +1,29 @@
#!/bin/sh
# DF_SRC_ROOT: dotfiles source root
# DF_RUNNER_WORKDIR: runner workdir
# DF_RUNNER_LIBS: libs to include in runner
# DF_RUNNER_VERBOSE: verbosity runner
if [ -n "$DF_RUNNER_WORKDIR" ]; then
[ $DF_RUNNER_VERBOSE ] && echo "workdir: $DF_RUNNER_WORKDIR"
DF_SRC_ROOT=${DF_SRC_ROOT:-$(pwd)}
cd $DF_RUNNER_WORKDIR
fi
for lib in ${DF_RUNNER_LIBS:-}; do
if [ -n "$DF_SRC_ROOT" ]; then
oldpwd=$(pwd)
cd $DF_SRC_ROOT
fi
[ $DF_RUNNER_VERBOSE ] && echo "include: lib/$lib.sh"
. lib/$lib.sh
if [ -n "$DF_SRC_ROOT" ]; then
cd $oldpwd
fi
done
[ $DF_RUNNER_VERBOSE ] && echo "command: $@"
$@