check_for_upgrade.sh is not executable with /bin/sh while using bash syntax, so the execution shell should be set to /bin/bash.
corrected shell for execution
Probably it is better to change it to zsh instead of bash, as we can't be sure that bash is installed everywhere?
use zsh instead of bash
use env command for executing zsh
- zsh is not always in /bin
Yes, of course, my fault.
Also the env command should be used, because the zsh binary is not always in the same place across different systems (e.g. /usr/bin/zsh is the location on my notebook).
Hi @MatthiasLohr, this is a cool PR, but I want to run a few tests first. Be aware though that check_for_upgrade.sh is executed from upgrade_oh_my_zsh function, which bypasses the shebang. Also, the script is fully compatible with /bin/sh now.
If you want to proceed with this PR, could you also add the appropriate shebang for the install.sh script (#1623) since both are very similar issues?
use environment path for executing installer with zsh
Hi @MatthiasLohr, we're gonna proceed with this PR, I need a couple of last favors from you:
Can we get some testers here? /cc @ncanceill @Kriechi
Will test shortly.
@MatthiasLohr please remember to rebase against current upstream, and take the opportunity to squash your commits in order to keep the history clean and atomic.
Hey @MatthiasLohr, can you get some time to rebase? The change in the README file from sh to zsh need to happen too. See my previous comment too: #1856 (comment)
Hey @mcornella, i'll try that, but at the moment i'm very busy, sry.
Hi @MatthiasLohr, any luck on finishing this up?
Is #!/usr/bin/env zsh the right shebang line for install.sh? That is run under sh during the install process, not zsh. So it needs to be kept to just sh-compatible syntax. Unless you're planning on changing the install process to run it through zsh instead?
And how about renaming check_for_upgrade.sh to check_for_upgrade.zsh? Same for theme_chooser.sh to theme_chooser.zsh, since it has a zsh shebang. That way all the file extensions and shebang lines are all consistent with the shell flavor the files are targeting.
Sorry for the late late response, this fell off the tracks. I'm going to build upon this PR to make the transition to a full-zsh codebase, but for the moment i'm closing this as there are many things to take into account.
Again, sorry for losing track of this PR and thank you for your all your work.