From 204ba6418419f1c0d15bbd774d24d03bfa225884 Mon Sep 17 00:00:00 2001 From: orangix Date: Sun, 13 Aug 2023 19:09:04 +0200 Subject: [PATCH] added justfile --- .air.toml | 4 ++-- justfile | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 justfile diff --git a/.air.toml b/.air.toml index bbd4b15..68b67d9 100644 --- a/.air.toml +++ b/.air.toml @@ -19,7 +19,7 @@ exclude_dir = ["tmp", "vendor", "node_modules"] # Watch these directories if you specified. include_dir = [] # Exclude files. -exclude_file = [] +exclude_file = ["./static/app.css"] # This log file places in your tmp_dir. log = "air.log" # It's not necessary to trigger build each time file changes if it's too frequent. @@ -44,4 +44,4 @@ runner = "green" [misc] # Delete tmp directory on exit -clean_on_exit = true \ No newline at end of file +clean_on_exit = true diff --git a/justfile b/justfile new file mode 100644 index 0000000..05ddf3c --- /dev/null +++ b/justfile @@ -0,0 +1,15 @@ +build: tailwind gc + +tailwind: + npx tailwindcss -i static/tailwind.css -o static/app.css -m + +gc: + #!/bin/sh -x + FILE=./rimgo + if [ "$ENV" = dev ]; then FILE=./tmp/rimgo; fi + go mod download + CGO_ENABLED=0 go build -o "$FILE" -ldflags "-X codeberg.org/rimgo/rimgo/pages.VersionInfo=$(date '+%Y-%m-%d')-$(git rev-list --abbrev-commit -1 HEAD)" + +dev: + go run github.com/cosmtrek/air@latest --build.cmd "ENV=dev just build" --build.bin ./tmp/rimgo +