From 7d5e062a21b9261adccbcdc02d136daab119d5f5 Mon Sep 17 00:00:00 2001 From: naskya Date: Mon, 22 Jan 2024 01:34:26 +0900 Subject: [PATCH] dev: update neko/index.js only when rusty stuff are updated --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 25ed2db73..fbb3398e0 100644 --- a/Makefile +++ b/Makefile @@ -9,13 +9,17 @@ RUST_DIR := packages/backend/native-utils CARGO_TOMLS := $(RUST_DIR)/Cargo.toml CARGO_TOMLS += $(RUST_DIR)/migration/Cargo.toml +RUSTY_STUFF := $(foreach dir, $(RUST_DIR)/src, $(wildcard $(dir)/*)) +RUSTY_STUFF += $(foreach dir, $(RUST_DIR)/migration/src, $(wildcard $(dir)/*)) +RUSTY_STUFF += $(CARGO_TOMLS) + .PHONY: build build: build-image .PHONY: pre-commit -pre-commit: shellcheck pnpm-lock.yaml $(RUST_DIR)/Cargo.lock regenerate-entities update-index-js rust-lint +pre-commit: shellcheck pnpm-lock.yaml $(RUST_DIR)/Cargo.lock regenerate-entities neko/index.js rust-lint pnpm-lock.yaml: pnpm-workspace.yaml $(PACKAGE_JSONS) @@ -64,8 +68,7 @@ regenerate-entities: $(RUST_DIR)/src/model/entity/sea_orm_active_enums.rs -.PHONY: update-index-js -update-index-js: +neko/index.js: $(RUSTY_STUFF) pnpm --filter='native-utils' run build:debug [ -f $(RUST_DIR)/built/index.js ] pnpm run format