Skip to content

Commit 56ef8a6

Browse files
committed
fix: execute bin directly and not via Node.js
This commit fixes commit linting for Windows, where the commitlint bin is not a Node.js script. To work around this, the make targets now run the commitlint bin directly, rather than via Node.js.
1 parent a2e039c commit 56ef8a6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/make/lib/lint/git/commitlint.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ COMMITLINT_FLAGS ?= \
5252
#/
5353
commitlint: $(NODE_MODULES)
5454
$(QUIET) mv $(ROOT_DIR)/tsconfig.json $(ROOT_DIR)/tsconfig.json.tmp
55-
$(QUIET) NODE_PATH="$(NODE_PATH)" $(NODE) "$(COMMITLINT)" $(COMMITLINT_FLAGS) --edit || ( mv $(ROOT_DIR)/tsconfig.json.tmp $(ROOT_DIR)/tsconfig.json && exit 1 )
55+
$(QUIET) "$(COMMITLINT)" $(COMMITLINT_FLAGS) --edit || ( mv $(ROOT_DIR)/tsconfig.json.tmp $(ROOT_DIR)/tsconfig.json && exit 1 )
5656
$(QUIET) mv $(ROOT_DIR)/tsconfig.json.tmp $(ROOT_DIR)/tsconfig.json
5757

5858
.PHONY: commitlint
@@ -71,7 +71,7 @@ commitlint: $(NODE_MODULES)
7171
#/
7272
commitlint-message: $(NODE_MODULES)
7373
$(QUIET) mv $(ROOT_DIR)/tsconfig.json $(ROOT_DIR)/tsconfig.json.tmp
74-
$(QUIET) ( printf "$(GIT_COMMIT_MESSAGE)" | NODE_PATH="$(NODE_PATH)" $(NODE) "$(COMMITLINT)" $(COMMITLINT_FLAGS) ) || ( mv $(ROOT_DIR)/tsconfig.json.tmp $(ROOT_DIR)/tsconfig.json && exit 1 )
74+
$(QUIET) ( printf "$(GIT_COMMIT_MESSAGE)" | "$(COMMITLINT)" $(COMMITLINT_FLAGS) ) || ( mv $(ROOT_DIR)/tsconfig.json.tmp $(ROOT_DIR)/tsconfig.json && exit 1 )
7575
$(QUIET) mv $(ROOT_DIR)/tsconfig.json.tmp $(ROOT_DIR)/tsconfig.json
7676

7777
.PHONY: commitlint-message
@@ -97,13 +97,13 @@ ifeq ($(FAIL_FAST), true)
9797
$(QUIET) for file in $(FILES); do \
9898
echo ''; \
9999
echo "Linting commit message:"; \
100-
( cat $$file | grep -v '^#' | $(NODE) "$(COMMITLINT)" $(COMMITLINT_FLAGS) ) || ( mv $(ROOT_DIR)/tsconfig.json.tmp $(ROOT_DIR)/tsconfig.json && exit 1 ); \
100+
( cat $$file | grep -v '^#' | "$(COMMITLINT)" $(COMMITLINT_FLAGS) ) || ( mv $(ROOT_DIR)/tsconfig.json.tmp $(ROOT_DIR)/tsconfig.json && exit 1 ); \
101101
done
102102
else
103103
$(QUIET) for file in $(FILES); do \
104104
echo ''; \
105105
echo "Linting commit message"; \
106-
( cat $$file | grep -v '^#' | $(NODE) "$(COMMITLINT)" $(COMMITLINT_FLAGS) ) || echo 'Linting failed.'; \
106+
( cat $$file | grep -v '^#' | "$(COMMITLINT)" $(COMMITLINT_FLAGS) ) || echo 'Linting failed.'; \
107107
done
108108
endif
109109
$(QUIET) mv $(ROOT_DIR)/tsconfig.json.tmp $(ROOT_DIR)/tsconfig.json

0 commit comments

Comments
 (0)