mirror of
https://github.com/opdavies/build-configs.git
synced 2025-01-22 18:27:31 +00:00
Oliver Davies
4e255cd667
...run file Prevent erroring if `run` is being executed within a sub-directory, like `assets`.
35 lines
700 B
Twig
Executable file
35 lines
700 B
Twig
Executable file
#!/usr/bin/env bash
|
|
|
|
# {{ managedText | raw }}
|
|
|
|
set -o errexit
|
|
set -o pipefail
|
|
|
|
# Disable Git hooks.
|
|
function git-hooks:off {
|
|
git config --unset core.hooksPath
|
|
}
|
|
|
|
# Enable Git hooks.
|
|
function git-hooks:on {
|
|
git config core.hooksPath .githooks
|
|
}
|
|
|
|
# Display a list of all available commands.
|
|
function help {
|
|
printf "%s <task> [args]\n\nTasks:\n" "${0}"
|
|
|
|
compgen -A function | grep -v "^_" | cat -n
|
|
|
|
printf "\nExtended help:\n Each task has comments for general usage\n"
|
|
}
|
|
|
|
# Include any local tasks.
|
|
# https://stackoverflow.com/a/6659698
|
|
[[ -e "${BASH_SOURCE%/*}/run.local" ]] && source "${BASH_SOURCE%/*}/run.local"
|
|
|
|
TIMEFORMAT=$'\nTask completed in %3lR'
|
|
time "${@:-help}"
|
|
|
|
# vim: ft=bash
|