From d71334cda7f08c3fc9921005e9b6ec38b8a43006 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Thu, 23 Jan 2025 16:58:55 -0800 Subject: [PATCH] Add air to devshell for live reloading --- .gitignore | 1 + Makefile | 7 +++++++ flake.nix | 1 + 3 files changed, 9 insertions(+) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 92b2793..a74398e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .direnv +tmp/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..90e711f --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +.PHONY: help serve + +help: ## display this help + @awk 'BEGIN{FS = ":.*##"; printf "\033[1m\nUsage\n \033[1;92m make\033[0;36m \033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } ' $(MAKEFILE_LIST) + +serve: ## Run "intake serve" with live reload + @air -build.cmd "go build -o scratch/intake" -build.bin scratch/intake -build.args_bin serve -build.exclude_dir scratch diff --git a/flake.nix b/flake.nix index 2138377..e6d70d2 100644 --- a/flake.nix +++ b/flake.nix @@ -30,6 +30,7 @@ pkgs.go-tools pkgs.gotools pkgs.cobra-cli + pkgs.air ]; }; };