forked from nixcn/nixcn-cms
17
justfile
17
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 .. ./...
|
||||
|
||||
Reference in New Issue
Block a user