Improve zsh compatibility in deploy/env scripts
This commit is contained in:
parent
7ed5bc9a86
commit
58e2577e66
10
deploy
10
deploy
|
@ -95,7 +95,7 @@ function topic-init {
|
||||||
echo-ok "$topic: added $topic/bin to PATH, temporarily"
|
echo-ok "$topic: added $topic/bin to PATH, temporarily"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $LINK ]] || ! topic-enabled-p $topic; then
|
if [[ -n $LINK ]] || ! topic-enabled-p $topic; then
|
||||||
local op=install
|
local op=install
|
||||||
mklink $tpath $tsympath
|
mklink $tpath $tsympath
|
||||||
_topic-do $topic link
|
_topic-do $topic link
|
||||||
|
@ -120,7 +120,7 @@ function topic-remove {
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ $INHIBIT_INIT ]] || _topic-do $topic clean
|
[[ -z $INHIBIT_INIT ]] && _topic-do $topic clean
|
||||||
_exec rm -f "$(topic-path $topic)" && \
|
_exec rm -f "$(topic-path $topic)" && \
|
||||||
echo-ok "Removed $topic" || \
|
echo-ok "Removed $topic" || \
|
||||||
echo-fail "Couldn't remove $topic"
|
echo-fail "Couldn't remove $topic"
|
||||||
|
@ -182,16 +182,16 @@ EOL
|
||||||
done
|
done
|
||||||
shift $((OPTIND-1))
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
if [[ $LIST ]]; then
|
if [[ -n $LIST ]]; then
|
||||||
_topics | tr ' ' $'\n'
|
_topics | tr ' ' $'\n'
|
||||||
else
|
else
|
||||||
pushd -qL "$DOTFILES"
|
pushd -qL "$DOTFILES"
|
||||||
if [[ $REMOVE ]]; then
|
if [[ -n $REMOVE ]]; then
|
||||||
topic-remove ${TARGETS:-$@}
|
topic-remove ${TARGETS:-$@}
|
||||||
else
|
else
|
||||||
topic-init ${TARGETS:-$@}
|
topic-init ${TARGETS:-$@}
|
||||||
fi
|
fi
|
||||||
[[ $CLEAN ]] && clean
|
[[ -n $CLEAN ]] && clean
|
||||||
popd -q
|
popd -q
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
2
env
2
env
|
@ -61,7 +61,7 @@ function _ensure_repo {
|
||||||
elif [[ $target =~ "^[^/]+$" ]]; then
|
elif [[ $target =~ "^[^/]+$" ]]; then
|
||||||
url=git@github.com:$USER/$target.git
|
url=git@github.com:$USER/$target.git
|
||||||
fi
|
fi
|
||||||
[[ ${dest%/*} ]] && mkdir -p ${dest%/*}
|
[[ -n ${dest%/*} ]] && mkdir -p ${dest%/*}
|
||||||
git clone --recursive "$url" "$dest" || return 1
|
git clone --recursive "$url" "$dest" || return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue