diff --git a/run b/run index 01561661..af34d776 100755 --- a/run +++ b/run @@ -4,12 +4,10 @@ set -o nounset set -o pipefail function clean { - rm -fr node_modules/ output_*/ source/build/ vendor/ + rm -fr output_*/ source/build/ } function generate { - rm -rf output_*/ - local args=() if [[ "${APP_ENV:-}" == "production" ]]; then @@ -43,5 +41,21 @@ function npm:build:css { --output source/build/tailwind.css "${args[@]}" } +function publish { + export NODE_ENV=production + export APP_ENV=production + + git stash + + clean + npm:build:css + generate + + rsync --archive --verbose --compress --update --delete \ + output_prod/ ssh.oliverdavies.uk:/srv/oliverdavies.uk-sculpin + + git stash pop +} + TIMEFORMAT="Task completed in %3lR" time "${@:-help}"