chore(run): replace justfiles with run files

This commit is contained in:
Oliver Davies 2023-10-07 22:23:40 +01:00
parent 3a86b4813a
commit f5a8c691f0
11 changed files with 386 additions and 263 deletions

View file

@ -1,25 +0,0 @@
# {{ managedText|raw }}
default:
@just --list
# Enable or disable Git hooks
git-hooks command:
#!/usr/bin/env bash
set -euo pipefail
case "{{ '{{ command }}'|raw }}" in
"on")
echo "Enabling Git hooks..."
git config core.hooksPath .githooks
;;
"off")
echo "Disabling Git hooks..."
git config --unset core.hooksPath
;;
*)
echo "Error: Invalid argument. Must be either 'on' or 'off'"
;;
esac
# vim: ft=just

29
templates/terraform/run.twig Executable file
View file

@ -0,0 +1,29 @@
#!/usr/bin/env bash
# {{ managedText | raw }}
set -eu
# 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"
}
TIMEFORMAT=$'\nTask completed in %3lR'
time "${@:-help}"
# vim: ft=bash