Upgrade fakefile

This commit is contained in:
Kevin van Zonneveld 2023-08-29 12:35:17 +02:00
parent 879422d09f
commit 55cd329ebd
No known key found for this signature in database
GPG Key ID: 5E20B81008764DF4
2 changed files with 22 additions and 5 deletions

View File

@ -3,6 +3,9 @@
#
# https://www.npmjs.com/package/fakefile
#
# Please do not edit this file directly, but propose changed upstream instead:
# https://github.com/kvz/fakefile/blob/main/Makefile
#
# This Makefile offers convience shortcuts into any Node.js project that utilizes npm scripts.
# It functions as a wrapper around the actual listed in `package.json`
# So instead of typing:
@ -25,10 +28,26 @@
# OSX users will have to install bash-completion
# (http://davidalger.com/development/bash-completion-on-os-x-with-brew/)
ifeq ($(shell test -e ./yarn.lock && echo -n yes),yes)
RUNNER=yarn
INSTALLER=yarn install
else
RUNNER=npm run
INSTALLER=npm install
endif
define npm_script_targets
TARGETS := $(shell node -e 'for (var k in require("./package.json").scripts) {console.log(k.replace(/:/g, "-"));}')
TARGETS := $(shell \
node -e 'for (var k in require("./package.json").scripts) {console.log(k.replace(/:/g, "-"));}'
| grep -v -E "^install$$"
)
$$(TARGETS):
npm run $(subst -,:,$(MAKECMDGOALS))
$(RUNNER) $(shell \
node -e 'for (var k in require("./package.json").scripts) {console.log(k.replace(/:/g, "-"), k);}'
| grep -E "^$(MAKECMDGOALS)\s"
| head -n1
| awk '{print $$2}'
)
.PHONY: $$(TARGETS)
endef
@ -37,4 +56,4 @@ $(eval $(call npm_script_targets))
# These npm run scripts are available, without needing to be mentioned in `package.json`
install:
npm run install
$(INSTALLER)

View File

@ -26,10 +26,8 @@
"fsevents": "*"
},
"devDependencies": {
"cross-env": "3.1.3",
"fakefile": "0.0.8",
"next-update": "1.5.1",
"npm-run-all": "3.1.2",
"replace": "0.3.0"
}
}