added justfile

This commit is contained in:
orangix 2023-08-13 19:09:04 +02:00
parent f29df4fbd9
commit 204ba64184
No known key found for this signature in database
GPG Key ID: C31D4A86601C8416
2 changed files with 17 additions and 2 deletions

View File

@ -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
clean_on_exit = true

15
justfile Normal file
View File

@ -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