diff --git a/local/bin/dots b/local/bin/dots index 2bb5992..70be887 100755 --- a/local/bin/dots +++ b/local/bin/dots @@ -25,9 +25,9 @@ 'clone-one'() { local url=$1 local package=${${url##*/}%.git} - # Simple package names are fetched from the configured source prefix. - [[ $url != */* ]] && url=$DOTS_SOURCE_PREFIX/$package - # user/repo packages are fetched from that user's GitHub repos. + # Simple package names are fetched from my GitHub repos. + [[ $url != */* ]] && url=$GITHUB_USER/dot-$package + # user/repo packages are fetched from that user's repos. [[ $url != *:* ]] && url=https://github.com/$url if [[ -d $DOTFILES/$package ]]; then echo "Looks like you already have $package cloned." >&2 @@ -128,26 +128,22 @@ done } -'main'() { - : ${DOTFILES:=~/dotfiles} ${STOW:=stow} ${DOTS_SOURCE_PREFIX:=https://git.00dani.me/dot} +: ${DOTFILES:=~/dotfiles} ${STOW:=stow} ${GITHUB_USER:=00dani} - comm=$1 - if (( $# == 0 )); then - if [[ -d $DOTFILES ]]; then - comm=status - else - comm=bootstrap - fi +comm=$1 +if (( $# == 0 )); then + if [[ -d $DOTFILES ]]; then + comm=status + else + comm=bootstrap fi +fi - case $comm in - bootstrap) bootstrap ;; - clone) clone ${argv[2,-1]} ;; - fetch) fetch ${argv[2,-1]} ;; - link) link ${argv[2,-1]} ;; - pull) pull ${argv[2,-1]} ;; - st|status) status ${argv[2,-1]} ;; - esac -} - -'main' +case $comm in + bootstrap) bootstrap ;; + clone) clone ${argv[2,-1]} ;; + fetch) fetch ${argv[2,-1]} ;; + link) link ${argv[2,-1]} ;; + pull) pull ${argv[2,-1]} ;; + st|status) status ${argv[2,-1]} ;; +esac