2024-01-03 20:00:00 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2024-01-26 08:15:06 +00:00
|
|
|
set -o errexit
|
2024-01-03 20:00:00 +00:00
|
|
|
set -o nounset
|
|
|
|
set -o pipefail
|
|
|
|
|
2024-01-26 08:15:06 +00:00
|
|
|
PATH="${PATH}:./vendor/bin"
|
2024-01-03 20:00:00 +00:00
|
|
|
|
2024-01-26 08:15:06 +00:00
|
|
|
# Generate the site.
|
2024-01-03 20:00:00 +00:00
|
|
|
function generate {
|
|
|
|
local args=()
|
|
|
|
|
|
|
|
if [[ "${APP_ENV:-}" == "production" ]]; then
|
|
|
|
args=(--env="prod")
|
|
|
|
else
|
|
|
|
args=(--server --watch)
|
|
|
|
fi
|
|
|
|
|
|
|
|
sculpin generate "${args[@]}"
|
|
|
|
}
|
|
|
|
|
|
|
|
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"
|
|
|
|
}
|
|
|
|
|
2024-01-26 08:15:06 +00:00
|
|
|
# Start the project.
|
|
|
|
function start {
|
|
|
|
sculpin generate --server --watch "${@}"
|
2024-01-03 20:00:00 +00:00
|
|
|
}
|
|
|
|
|
2024-01-26 08:15:06 +00:00
|
|
|
# Include any local tasks.
|
|
|
|
[[ -e run.local ]] && source run.local
|
2024-01-03 20:00:00 +00:00
|
|
|
|
2024-01-03 20:00:00 +00:00
|
|
|
TIMEFORMAT="Task completed in %3lR"
|
|
|
|
time "${@:-help}"
|
2024-01-26 08:15:06 +00:00
|
|
|
|
|
|
|
# vim: ft=bash
|