mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-04-17 04:29:14 +02:00
fixing variable names, letting user know what to do after work is stashed
This commit is contained in:
parent
d1f769b147
commit
c76f35183f
1 changed files with 14 additions and 11 deletions
|
|
@ -31,7 +31,6 @@ success_upgrading() {
|
||||||
printf "${BLUE}%s\n" "Hooray! Oh My Zsh has been updated and/or is at the current version."
|
printf "${BLUE}%s\n" "Hooray! Oh My Zsh has been updated and/or is at the current version."
|
||||||
printf "${BLUE}${BOLD}%s${NORMAL}\n" "To keep up on the latest news and updates, follow us on twitter: https://twitter.com/ohmyzsh"
|
printf "${BLUE}${BOLD}%s${NORMAL}\n" "To keep up on the latest news and updates, follow us on twitter: https://twitter.com/ohmyzsh"
|
||||||
printf "${BLUE}${BOLD}%s${NORMAL}\n" "Get your Oh My Zsh swag at: http://shop.planetargon.com/"
|
printf "${BLUE}${BOLD}%s${NORMAL}\n" "Get your Oh My Zsh swag at: http://shop.planetargon.com/"
|
||||||
exit 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
error_upgrading() {
|
error_upgrading() {
|
||||||
|
|
@ -42,9 +41,9 @@ error_upgrading() {
|
||||||
run_upgrade() {
|
run_upgrade() {
|
||||||
if git pull --rebase --stat origin master
|
if git pull --rebase --stat origin master
|
||||||
then
|
then
|
||||||
success_updating
|
success_upgrading
|
||||||
else
|
else
|
||||||
error_updating
|
error_upgrading
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -53,14 +52,18 @@ cd "$ZSH"
|
||||||
|
|
||||||
if output=$(git status --porcelain); then
|
if output=$(git status --porcelain); then
|
||||||
while true; do
|
while true; do
|
||||||
printf "${RED}%s${NORMAL}\n" "You have changes that are preventing Oh My Zsh from upgrading."
|
printf "${RED}%s${NORMAL}\n" "You have changes that are preventing Oh My Zsh from upgrading."
|
||||||
printf "${RED}%s${NORMAL}" "Do you want to stash these changes and continue? "
|
printf "${RED}%s${NORMAL}" "Do you want to stash these changes and continue? "
|
||||||
read -p "" answer
|
read -p "" answer
|
||||||
case $answer in
|
case $answer in
|
||||||
[Yy]* ) git stash; run_update;;
|
[Yy]* )
|
||||||
[Nn]* ) exit;;
|
git stash;
|
||||||
* ) echo "Please answer yes or no.";;
|
run_upgrade;
|
||||||
esac
|
printf "${RED}%s${NORMAL}\n" "Run 'cd ~/.oh-my-zsh && git stash pop' if you need the stashed changes back.";
|
||||||
|
exit;;
|
||||||
|
[Nn]* ) exit;;
|
||||||
|
* ) echo "Please answer yes or no.";;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
run_update
|
run_update
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue