kc9wwh / macOSUpgrade

Workflow for doing in-place upgrades.
Other
418 stars 103 forks source link

Feature Request: Exit on error when requirements not met #26

Closed Whitebeer1337 closed 7 years ago

Whitebeer1337 commented 7 years ago

At the moment the script finishes succesful, even if the requirements are not met. It would be nice to have the failed policy-instances marked with 'failed'. This would open the possibility to just flush the failed ones without opening every single logdata from the computer.

btw. really cool script, works great for us 👍

kc9wwh commented 7 years ago

Hey @Whitebeer1337, the reason I did not use exit codes for when the script fails whether it be to a missing file or the requirements not being met is because when this is run via Self Service and an exit code other than 0 is utilized, Self Service will also display a generic error prompt to the end-user which made it more confusing and less friendly.

However, if you'd like to use an exit code, you can add and exit 1 to line 230. This would then provide the failure you were looking for when a requirement is not met.

Whitebeer1337 commented 7 years ago

Hey, thank you for your quick reply! Sounds plausible with this explanation 👍 I realized a userchoice with this script, so the users can decide when to upgrade their macbooks in a timeframe of 4 weeks via selfservice. After that I launch a second policy to force the upgrade without any possibility to interrupt.