Made installer install current branch and not master

This commit is contained in:
Simon Pettersson 2017-10-05 19:51:39 +02:00
parent adecf4c368
commit eab7ff26cf

View File

@ -61,7 +61,14 @@ main() {
exit 1 exit 1
fi fi
fi fi
env git clone --depth=1 $(git remote get-url origin) $ZSH || {
branch="$(env git symbolic-ref --short HEAD)"
if [[ "$?" != "0" ]] || [[ "$branch" == "" ]]; then
printf "Error: failed to get current git branch\n"
exit 1
fi
env git clone --depth=1 $(git remote get-url origin) -b "$branch" $ZSH || {
printf "Error: git clone of oh-my-zsh repo failed\n" printf "Error: git clone of oh-my-zsh repo failed\n"
exit 1 exit 1
} }