You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It might be nice to consolidate the nested if ... else ... fi blocks into an iterative loop over a bash associative array. As new installers are supported they can be added in a declarative manner instead of a deeply nested if block.
Pseudocode would look something like:
# Initdeclare -a installers
installers=(
["Sierra"]="Install macOS Sierra.app",
["ElCapitan"]="Install OS X El Capitan.app",
["Yosemite"]="Install OS X Yosemite.app"
)
# Loopforiso_namein"${!installers[@]}";do
installerExists "${installers[$iso_name]}"
result=$?if [ ${result}-eq 0 ] ;then
createISO "${installers[$iso_name]}""${iso_name}"exit 0
fidone# Failureecho"Could not find any installer"exit 1
The text was updated successfully, but these errors were encountered:
It might be nice to consolidate the nested
if ... else ... fi
blocks into an iterative loop over a bash associative array. As new installers are supported they can be added in a declarative manner instead of a deeply nestedif
block.Pseudocode would look something like:
The text was updated successfully, but these errors were encountered: