Skip to content

Instantly share code, notes, and snippets.

@neowulf
Last active May 19, 2025 16:31
Show Gist options
  • Save neowulf/45d113a2711114a3aa79926e78e9deab to your computer and use it in GitHub Desktop.
Save neowulf/45d113a2711114a3aa79926e78e9deab to your computer and use it in GitHub Desktop.
Bash Template
#!/usr/bin/env bash
set -eou pipefail
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
PROJECT_DIR=$(git rev-parse --show-toplevel)
function task() {
}
## process specific command and exit
args=("$@")
if ((${#args[@]})); then
"$@"
exit $?
fi
# if no specific command passed, process default commands
task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment