stow: update stow deployment

This commit is contained in:
Marco Thomas
2023-09-28 13:15:50 +00:00
committed by Marco Thomas
parent 9202762eed
commit bde3f632d5
3 changed files with 22 additions and 17 deletions

33
stow.sh
View File

@@ -1,18 +1,23 @@
#!/bin/bash
FILES_DIR=$PWD/files
OPTS=$1
# Utility script to stow or un-stow configuration
echo "You are about to stow all config files."
echo "Do you want to proceed? [y]"
read proceed
set -e
if [ "${proceed}" != "y" ]; then
echo "Exiting!"
exit
fi
echo "Stowing configs..."
cd $FILES_DIR
stow ${OPTS} -v --target="$HOME" *
echo "Done!"
for i in "$1"
do
case $i in
-s|--stow)
echo "Stowing configuration for $2"
stow -v -d files -t $HOME $2
;;
-u|--unstow)
echo "Deleting configuration for $2"
stow -D -v -d files -t $HOME $2
;;
*)
echo "Unknown option (neither -s, not -u), exiting."
exit -1
;;
esac
done