This repository has been archived on 2025-04-01. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
ssg-test/run

37 lines
662 B
Text
Raw Permalink Normal View History

2025-02-19 12:30:11 +00:00
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
2025-02-19 12:54:02 +00:00
export PATH="${PATH}:./result/bin"
2025-02-19 12:30:11 +00:00
function clean {
rm -fr dst "${@}"
mkdir dst
}
2025-02-19 12:54:02 +00:00
function css-build {
tailwindcss --config assets/tailwind.config.ts \
--output src/css/tailwind.css "${@}"
}
2025-02-19 12:30:11 +00:00
function generate {
2025-02-19 12:54:02 +00:00
ssg "src" "dst" "Oliver Davies" "https://www.oliverdavies.uk"
}
function watch {
find src -type f | entr ./run generate
2025-02-19 12:30:11 +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"
}
TIMEFORMAT="Task completed in %3lR"
time "${@:-help}"