From 56f0f8a2edde06b52db270ccb76f776e9c92eeb1 Mon Sep 17 00:00:00 2001 From: Joey Chilson Date: Thu, 21 Dec 2023 14:54:05 -0600 Subject: [PATCH] Added air for live reload --- .air.toml | 46 ++++++++++++++++++++++++++++++++++++++++++++++ .gitignore | 1 + Makefile | 7 +++++-- 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 .air.toml create mode 100644 .gitignore diff --git a/.air.toml b/.air.toml new file mode 100644 index 0000000..1402d38 --- /dev/null +++ b/.air.toml @@ -0,0 +1,46 @@ +root = "." +testdata_dir = "testdata" +tmp_dir = "tmp" + +[build] + args_bin = [] + bin = "./tmp/main" + cmd = "make build" + delay = 1000 + exclude_dir = ["assets", "tmp", "vendor", "testdata"] + exclude_file = [] + exclude_regex = ["_test.go", "_templ.go"] + exclude_unchanged = false + follow_symlink = false + full_bin = "" + include_dir = [] + include_ext = ["go", "tpl", "tmpl", "html", "templ"] + include_file = [] + kill_delay = "0s" + log = "build-errors.log" + poll = false + poll_interval = 0 + post_cmd = [] + pre_cmd = [] + rerun = false + rerun_delay = 500 + send_interrupt = false + stop_on_error = false + +[color] + app = "" + build = "yellow" + main = "magenta" + runner = "green" + watcher = "cyan" + +[log] + main_only = false + time = false + +[misc] + clean_on_exit = false + +[screen] + clear_on_rebuild = false + keep_scroll = true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cad2309 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/tmp \ No newline at end of file diff --git a/Makefile b/Makefile index 0b67cc9..52ea903 100644 --- a/Makefile +++ b/Makefile @@ -6,5 +6,8 @@ templ: css: tailwindcss -i ./assets/tailwind.css -o ./assets/app.css -app: - go run main.go \ No newline at end of file +run: + go run main.go + +build: + templ generate && tailwindcss -i ./assets/tailwind.css -o ./assets/app.css && go build -o ./tmp/main . \ No newline at end of file