From fcccf2eb2984f3ce6ef6cf52399c8a226bd5b6aa Mon Sep 17 00:00:00 2001 From: naskya Date: Sun, 14 Jan 2024 20:15:05 +0900 Subject: [PATCH] dev: update Makefile --- Makefile | 26 +++++++++++++------------- neko/update/utils | 2 ++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 6c196086..2b9e2342 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ .PHONY: build -build: build_image +build: build-image .PHONY: pre-commit -pre-commit: shellcheck format rust-lint regenerate-entities +pre-commit: shellcheck rust-lint regenerate-entities update-index-js .PHONY: debug @@ -17,16 +17,7 @@ debug: .PHONY: shellcheck shellcheck: shellcheck --external-sources update.sh - shellcheck --external-sources neko/update/main.sh - shellcheck --external-sources neko/update/patch.sh - shellcheck --external-sources neko/update/container.sh - shellcheck --external-sources neko/update/native.sh - shellcheck --external-sources --exclude=SC2148 neko/update/utils - - -.PHONY: format -format: - pnpm run format + shellcheck --external-sources neko/update/* .PHONY: rust-lint @@ -42,7 +33,16 @@ regenerate-entities: --database-url='postgres://firefish:password@localhost/firefish_db' -.PHONY: build_image +.PHONY: update-index-js +update-index-js: + pnpm --filter='native-utils' run build:debug + [ -f packages/backend/native-utils/built/index.js ] + pnpm run format + rm neko/index.js + cp packages/backend/native-utils/built/index.js neko/index.js + + +.PHONY: build-image build_image: . neko/update/utils && \ buildah build \ diff --git a/neko/update/utils b/neko/update/utils index ec0af597..315eef5a 100644 --- a/neko/update/utils +++ b/neko/update/utils @@ -1,3 +1,5 @@ +# shellcheck disable=SC2148 + color() { if [ -t 1 ]; then tput setaf "${1:-7}"