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)`
|
go_cmd := `realpath $(which go)`
|
||||||
bun_cmd := `realpath $(which bun)`
|
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:
|
install:
|
||||||
cd {{ client_dir }} && {{ bun_cmd }} install
|
cd {{ client_dir }} && {{ bun_cmd }} install
|
||||||
@@ -17,12 +19,17 @@ clean:
|
|||||||
mkdir -p {{ output_dir }}
|
mkdir -p {{ output_dir }}
|
||||||
cp {{ join(project_dir, "config.default.yaml") }} {{ join(output_dir, "config.yaml") }}
|
cp {{ join(project_dir, "config.default.yaml") }} {{ join(output_dir, "config.yaml") }}
|
||||||
|
|
||||||
build:
|
client-dev:
|
||||||
{{ go_cmd }} build -o {{ exec_path }}{{ if os() == "windows" { ".exe" } else { "" } }} {{ server_enrty }}
|
cd {{ client_dir }} && {{ bun_cmd }} dev
|
||||||
|
|
||||||
|
build-client:
|
||||||
cd {{ client_dir }} && {{ bun_cmd }} run build --outDir {{ join(output_dir, "static") }}
|
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 { "" } }}
|
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 .. ./...
|
cd {{ output_dir }} && CONFIG_PATH={{ output_dir }} GO_ENV=test go test -C .. ./...
|
||||||
|
|||||||
Reference in New Issue
Block a user