Skip to content

Instantly share code, notes, and snippets.

@fbricon
Created December 4, 2021 22:36
Show Gist options
  • Save fbricon/2bcf2e8af51aec8fafff922c11d0cfa3 to your computer and use it in GitHub Desktop.
Save fbricon/2bcf2e8af51aec8fafff922c11d0cfa3 to your computer and use it in GitHub Desktop.
sayvn
#!/usr/bin/env sh
# License: Apache 2.0
# Description: Sayvn is a Wrapper for the Maven Wrapper that notifies you via the OSX say command whether a task failed or succeeded.
# Sayvn is a port of Sam Edwards' Saydle wrapper for Gradle
# Orginal Saydle Source: https://github.com/handstandsam/saydle/
# Version: 1.0.0-alpha01
# Customizations
success_phrase="Success"
failed_phrase="Failed"
voice="Alex"
# Sayvn Script
pullargs () {
for i do printf %s "$i " ; done
}
orig_mvnw_args=$(pullargs "$@") # Will store all the arguments sent to ./sayvnw
mvnw_cmd="./mvnw $orig_mvnw_args" # mvnw Command
success_cmd="say -v $voice \"$success_phrase\"" # On Success
failed_cmd="say -v $voice \"$failed_phrase\"" # On Failure
full_cmd="$mvnw_cmd && $success_cmd || $failed_cmd" # Command to Execute
echo "Executing: $mvnw_cmd"
echo "Sayvn will say 🔊 \"$success_phrase\" ✅ or \"$failed_phrase\" ❌ on completion."
# Execute
eval $full_cmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment