Wrap the loose commands at the end of dots in a function too, to help guarantee harmless crashing if the script's download is interrupted
This commit is contained in:
parent
316108268f
commit
d01591a0d4
1 changed files with 20 additions and 16 deletions
|
@ -128,22 +128,26 @@
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
: ${DOTFILES:=~/dotfiles} ${STOW:=stow} ${GITHUB_USER:=00dani}
|
'main'() {
|
||||||
|
: ${DOTFILES:=~/dotfiles} ${STOW:=stow} ${GITHUB_USER:=00dani}
|
||||||
|
|
||||||
comm=$1
|
comm=$1
|
||||||
if (( $# == 0 )); then
|
if (( $# == 0 )); then
|
||||||
if [[ -d $DOTFILES ]]; then
|
if [[ -d $DOTFILES ]]; then
|
||||||
comm=status
|
comm=status
|
||||||
else
|
else
|
||||||
comm=bootstrap
|
comm=bootstrap
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case $comm in
|
case $comm in
|
||||||
bootstrap) bootstrap ;;
|
bootstrap) bootstrap ;;
|
||||||
clone) clone ${argv[2,-1]} ;;
|
clone) clone ${argv[2,-1]} ;;
|
||||||
fetch) fetch ${argv[2,-1]} ;;
|
fetch) fetch ${argv[2,-1]} ;;
|
||||||
link) link ${argv[2,-1]} ;;
|
link) link ${argv[2,-1]} ;;
|
||||||
pull) pull ${argv[2,-1]} ;;
|
pull) pull ${argv[2,-1]} ;;
|
||||||
st|status) status ${argv[2,-1]} ;;
|
st|status) status ${argv[2,-1]} ;;
|
||||||
esac
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
'main'
|
||||||
|
|
Loading…
Reference in a new issue