Move to gnu/stow

This commit is contained in:
Hactarus 2022-08-26 00:03:16 +02:00
parent 4b1fda2809
commit c9d482f576
3 changed files with 67 additions and 8 deletions

43
setup.sh Executable file
View file

@ -0,0 +1,43 @@
#!/usr/bin/env bash
# make sure we have pulled in and updated any submodules
git submodule init
git submodule update
# what directories should be installable by all users including the root user
base=(
bash
)
# folders that should, or only need to be installed for a local user
useronly=(
git
)
# run the stow command for the passed in directory ($2) in location $1
stowit() {
usr=$1
app=$2
# -v verbose
# -R recursive
# -t target
stow -v -R -t ${usr} ${app}
}
echo ""
echo "Stowing apps for user: ${whoami}"
# install apps available to local users and root
for app in ${base[@]}; do
stowit "${HOME}" $app
done
# install only user space folders
for app in ${useronly[@]}; do
if [[! "$(whoami)" = *"root"*]]; then
stowit "${HOME}" $app
fi
done
echo ""
echo "##### ALL DONE"