fix: shellcheck

pull/13/head
kevin zhuang 4 years ago
parent 8000d6a2a2
commit 549545526a

@ -39,7 +39,6 @@ function usage() {
echo -e " fbackup \t\tperform backup for tracked dotfiles"
echo -e " fupgrade \t\tupdate dotbare to the latest version"
echo -e " finit \t\tinitialise/migrate dotbare"
echo -e " help \t\tshow this help message and exit"
}
# if no argument, display all possible actions
@ -62,8 +61,9 @@ case "$1" in
exit 0
;;
-v|--version)
cd "${mydir}"
printf "Current dotbare version: %s\n" "$(git describe --tags $(git rev-list --tags --max-count=1))"
cd "${mydir}" || exit
dotbare_version=$(git describe --tags "$(git rev-list --tags --max-count=1)")
printf "Current dotbare version: %s\n" "${dotbare_version}"
exit 0
;;
*)

@ -33,12 +33,13 @@ resetAutoStash=$(git config --bool rebase.autoStash 2>&1)
git config rebase.autoStash true
# change directory to dotbare folder
cd "${mydir}/.."
cd "${mydir}/.." || exit
echo "Updating dotbare ..."
if git pull --rebase --stat origin master; then
echo "dotbare updated successfully"
printf "Current dotbare version: %s\n" "$(git describe --tags $(git rev-list --tags --max-count=1))"
dotbare_version=$(git describe --tags "$(git rev-list --tags --max-count=1)")
printf "Current dotbare version: %s\n" "${dotbare_version}"
else
echo "Something went wrong, please try again or fire up a issue at https://github.com/kazhala/dotbare"
fi

Loading…
Cancel
Save