stow: update stow deployment
This commit is contained in:
committed by
Marco Thomas
parent
9202762eed
commit
bde3f632d5
@@ -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
|
||||
|
||||
@@ -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
33
stow.sh
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user