From 7d76b850553e01d63759f32b035fe494a21f0f02 Mon Sep 17 00:00:00 2001 From: Asai Neko Date: Sun, 28 Dec 2025 16:22:28 +0800 Subject: [PATCH] Expend justfile functions Signed-off-by: Asai Neko --- justfile | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/justfile b/justfile index 179416f..82c35bb 100644 --- a/justfile +++ b/justfile @@ -7,7 +7,9 @@ exec_path := join(output_dir, project_name) go_cmd := `realpath $(which go)` bun_cmd := `realpath $(which bun)` -default: install clean build run +default: install clean build-back build-client run-back + +backend: install clean build-back run-back install: cd {{ client_dir }} && {{ bun_cmd }} install @@ -17,12 +19,17 @@ clean: mkdir -p {{ output_dir }} cp {{ join(project_dir, "config.default.yaml") }} {{ join(output_dir, "config.yaml") }} -build: - {{ go_cmd }} build -o {{ exec_path }}{{ if os() == "windows" { ".exe" } else { "" } }} {{ server_enrty }} +client-dev: + cd {{ client_dir }} && {{ bun_cmd }} dev + +build-client: cd {{ client_dir }} && {{ bun_cmd }} run build --outDir {{ join(output_dir, "static") }} -run: +build-back: + {{ go_cmd }} build -o {{ exec_path }}{{ if os() == "windows" { ".exe" } else { "" } }} {{ server_enrty }} + +run-back: cd {{ output_dir }} && CONFIG_PATH={{ output_dir }} {{ exec_path }}{{ if os() == "windows" { ".exe" } else { "" } }} -test: +test-back: cd {{ output_dir }} && CONFIG_PATH={{ output_dir }} GO_ENV=test go test -C .. ./...