From 119b725525a8430b32ee7a6e6009b4ece544e39b Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 15 May 2019 18:50:14 +0200 Subject: [PATCH] use relative paths to node bin scripts, removing npx --- Makefile | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index ac61a58dd6..e429ff7781 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ endif BINDATA := modules/{options,public,templates}/bindata.go GOFILES := $(shell find . -name "*.go" -type f ! -path "./vendor/*" ! -path "*/bindata.go") GOFMT ?= gofmt -s +NODE_BIN := $(PWD)/node_modules/.bin GOFLAGS := -i -v EXTRA_GOFLAGS ?= @@ -367,22 +368,24 @@ release-compress: .PHONY: js js: - @hash npx > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ - echo "Please install npm version 5.2+"; \ + @if ([ ! -d "$(NODE_BIN)" ]); then \ + echo "node_modules directory is absent, please run 'npm install' first"; \ exit 1; \ fi; - npx eslint public/js + + $(NODE_BIN)/eslint public/js .PHONY: css css: - @hash npx > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ - echo "Please install npm version 5.2+"; \ + @if ([ ! -d "$(NODE_BIN)" ]); then \ + echo "node_modules directory is absent, please run 'npm install' first"; \ exit 1; \ fi; - npx lesshint public/less/ - npx -p less lessc --clean-css="--s0 -b" public/less/index.less public/css/index.css - $(foreach file, $(filter-out public/less/themes/_base.less, $(wildcard public/less/themes/*)),npx -p less lessc --clean-css="--s0 -b" public/less/themes/$(notdir $(file)) > public/css/theme-$(notdir $(call strip-suffix,$(file))).css;) - npx postcss --use autoprefixer --no-map --replace public/css/* + + $(NODE_BIN)/lesshint public/less/ + $(NODE_BIN)/lessc --clean-css="--s0 -b" public/less/index.less public/css/index.css + $(foreach file, $(filter-out public/less/themes/_base.less, $(wildcard public/less/themes/*)),$(NODE_BIN)/lessc --clean-css="--s0 -b" public/less/themes/$(notdir $(file)) > public/css/theme-$(notdir $(call strip-suffix,$(file))).css;) + $(NODE_BIN)/postcss --use autoprefixer --no-map --replace public/css/* @diff=$$(git diff public/css/*); \ if ([ ! -z "$CI" ] && [ -n "$$diff" ]); then \ -- 2.39.5