myspaghetti / macos-virtualbox

Push-button installer of macOS Catalina, Mojave, and High Sierra guests in Virtualbox on x86 CPUs for Windows, Linux, and macOS
GNU General Public License v2.0
13.5k stars 1.12k forks source link

Remove zsh noclobber, suggest ignoring rc files #556

Closed someuser12 closed 2 years ago

someuser12 commented 2 years ago

In case the user has some zsh RC files (e.g. .zshrc), it should be better to ignore them when running macos-guest-virtualbox.sh, by adding -f option to zsh's command line. Otherwise, the script might not run smoothly (e.g. rm might ask for confirmation of every single file deletion if it was aliases to "rm -i" in .zshrc), or even break (if the noclobber option of zsh was set up in .zshrc). As an additional caution, the option noclobber can be deactivated in the beginning of the script --- that way, lines overwriting or adding to .sh or .txt files will still work even though .zshrc was read and set this option.

myspaghetti commented 2 years ago

I'd really rather leave handling non-default behavior to the user. By default, zsh clobbers and rm runs without -i and this is the expected behavior. For example if someone decides to alias rm in /etc/zshenv or /etc/zsh/zshenv then invoking zsh with -f won't help anyway, which is why figuring out non-default behavior is out-of-scope for this script. The user should handle any non-default configuration they may have set.