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

View File

@@ -26,8 +26,8 @@ __prompt_command() {
local EXIT="$?"
export PS1="${HOST} ${DIR} ${GIT}${NEWLINE}"
local red_lambda='\[\033[0;31m\]>\[\033[00m\] '
local green_lambda='\[\033[0;32m\]>\[\033[00m\] '
local red_lambda='\[\033[0;31m\]󱞩\[\033[00m\] '
local green_lambda='\[\033[0;32m\]󱞩\[\033[00m\] '
if [ $EXIT != 0 ]
then

View File

@@ -9,7 +9,7 @@ precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
setopt prompt_subst
ICON="%(?.%{$fg[green]%}.%{$fg[red]%})>"
ICON="%(?.%{$fg[green]%}.%{$fg[red]%})󱞩"
DIR="%{$fg[blue]%}%~"
GIT="%{$fg[red]%}\$vcs_info_msg_0_"
HOSTN="%{$fg[yellow]%}%m "

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