start using GNU stow

add more configurations to the dotfiles directory
This commit is contained in:
2025-05-30 15:22:23 +02:00
parent 5e41320faf
commit 519455fac7
20 changed files with 204 additions and 0 deletions

29
.local/bin/buildconfig Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
BUILD_CONFIG=
# try to find a valid build config path
if [ -n "${1+x}" ] && [ -f "$1" ] && [[ "$(basename "$1")" == ".buildconfig" ]]; then BUILD_CONFIG="$1" # first check if a build config has been specified, and whether it's a valid path
elif [ -n "${1+x}" ]; then echo "E: the specified path '$1' is not a valid path!"; exit 1
elif [[ -f "$PWD/.buildconfig" ]]; then BUILD_CONFIG="$PWD/.buildconfig" # then check if there is a build config in the current working directory
elif [[ -f "$HOME/.buildconfig" ]]; then BUILD_CONFIG="$HOME/.buildconfig" # then check if there is a build config in the home directory
else $EDITOR .buildconfig
#else echo "E: could not find a .buildconfig file and none was specified!"; exit 1
fi
source "$BUILD_CONFIG"
[ -z "${cmd+x}" ] && { echo "E: cmd was not set! '$BUILD_CONFIG'"; exit 1; }
[ -z "${arg+x}" ] && { echo "E: arg was not set! '$BUILD_CONFIG'"; exit 1; }
# export the environment variables if they've been set
if [[ -n ${env+x} ]]; then
for var in "${!env[@]}"; do
export "$var=${env[$var]}"
done
fi
# execute the command with the arguments
# don't mind if the user made arguments separate out, that would likely be the user's intention
$cmd "$arg"
exit $?