dotfiles/runner

29 lines
652 B
Text
Raw Permalink Normal View History

2024-06-04 01:33:44 +02:00
#!/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: $@"
$@