oliverdavies.uk/run

45 lines
893 B
Plaintext
Raw Permalink Normal View History

2024-01-03 20:00:00 +00:00
#!/usr/bin/env bash
2024-01-31 09:12:48 +00:00
# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs.
set -o errexit
2024-01-03 20:00:00 +00:00
set -o nounset
set -o pipefail
PATH="${PATH}:./vendor/bin"
2024-01-03 20:00:00 +00:00
# Generate the site.
2024-01-03 20:00:00 +00:00
function generate {
local args=()
2024-08-18 11:09:39 +00:00
if [[ "${APP_ENV:-}" == "prod" ]]; then
2024-01-03 20:00:00 +00:00
args=(--env="prod")
else
args=(--server --watch)
fi
2024-01-31 09:12:48 +00:00
sculpin generate "${args[@]}" "${@}"
2024-01-03 20:00:00 +00:00
}
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"
}
# Start the project.
function start {
sculpin generate --server --watch "${@}"
2024-01-03 20:00:00 +00:00
}
# Include any local tasks.
2024-07-31 00:22:06 +00:00
# https://stackoverflow.com/a/6659698
[[ -e "${BASH_SOURCE%/*}/run.local" ]] && source "${BASH_SOURCE%/*}/run.local"
2024-01-03 20:00:00 +00:00
TIMEFORMAT="Task completed in %3lR"
time "${@:-help}"
# vim: ft=bash