Skip to content

Instantly share code, notes, and snippets.

@arthurpalves
Last active February 19, 2021 12:49
Show Gist options
  • Save arthurpalves/f52b81615be5c40030956446c91bf5de to your computer and use it in GitHub Desktop.
Save arthurpalves/f52b81615be5c40030956446c91bf5de to your computer and use it in GitHub Desktop.
Notify me with a notification that a task has been completed
# USAGE:
# notify pod install --repo-update
# Place this function at the end of your file
notify() {
body=""
for parameter in $@
do
body+=" $parameter"
done
# Remove '\"', making sure it can be displayed in the notification's body.
body=`echo "$body" | sed 's/\"//g'`
# Run command and send a local notification when it's completed.
$@ && \
osascript -e "display notification \"$body\" with title \"Task Completed\""
}
@marcusziade
Copy link

💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment