Last active
February 19, 2021 12:49
-
-
Save arthurpalves/f52b81615be5c40030956446c91bf5de to your computer and use it in GitHub Desktop.
Notify me with a notification that a task has been completed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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\"" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
💯