oliverdavies.uk/run

48 lines
834 B
Bash
Executable file

#!/usr/bin/env bash
set -o nounset
set -o pipefail
function clean {
rm -fr node_modules/ output_*/ source/build/ vendor/
}
function generate {
rm -rf output_*/
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"
}
function npm:build:css {
local args=()
if [[ "${NODE_ENV:-}" == "production" ]]; then
args=(--minify)
else
args=(--watch)
fi
npx tailwindcss \
--config assets/tailwind.config.ts \
--output source/build/tailwind.css "${args[@]}"
}
TIMEFORMAT="Task completed in %3lR"
time "${@:-help}"