-
-
Notifications
You must be signed in to change notification settings - Fork 37
after.sh
Nils edited this page Dec 1, 2016
·
1 revision
after.sh
is generated and executed after the installation of the packages (packages.list
).
If the script is only to be executed under a specific operating system, save it in the respective folder (for example, MACOS
)
Create your own files without #!/bin/bash
at the beginning.
The following functions can help you:
-
echo_step "your text"
→ outputs a step collored in cyan, without outputing a newline -
echo_warning "your text"
→ outputs [ WARNING ] in yellow, at the rightmost side of the screen -
echo_success
→ outputs [ OK ] in green, at the rightmost side of the screen -
exit_with_failure "your text"
→ outputs and logs a message before exiting the script and outputs [ FAILED ] in red, at the rightmost side of the screen.
You should redirect outputs to the log >>"$INSTALL_LOG" 2>&1
.
Also take care that the commands do not expect any input.
Trigger a Notification Center notification from an AppleScript
echo_step " Trigger a Notification Center notification"
osascript -e 'display notification "Installation completed 👍 "' 2>&1
if [ "$?" -ne 0 ]; then
echo_warning "Failed to trigger notification, will attempt to continue"
else
echo_success
fi
echo_success
fi