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.46k stars 1.11k forks source link

Tidy the script startup code #540

Closed slowpeek closed 2 years ago

slowpeek commented 2 years ago

Changes:

Improvements:

Btw I intentionally dont quote the left side in [[ $a == "$b" ]] conditions. It is not required in bash. As for zsh I refer to this piece from the docs:

Normal shell expansion is performed on the file, string and pattern arguments, but the result of each expansion is constrained to be a single word, similar to the effect of double quotes.

slowpeek commented 2 years ago

Are you sure you've read into the PR text and the code? The very first line says:

$stages and $specified_arguments are ARRAYS now (were strings).

Hence your objections are irrelevant.

Perhaps your bash is configured differently than the default? By default bash treats a string in quotes as a single parameter. Plus I'd like to preserve zsh compatibility.

You've got wrong every single word I've said.

myspaghetti commented 2 years ago

Did you forget to commit the change that made them into arrays?

myspaghetti commented 2 years ago

Oh would you look at that, they're arrays. Huh.

slowpeek commented 2 years ago

Oh would you look at that, they're arrays. Huh.

Haha, yeah. Thats what the PR message says.