mirror of
https://github.com/kvz/bash3boilerplate.git
synced 2024-12-18 14:26:22 +00:00
Upgrade fakefile
This commit is contained in:
parent
879422d09f
commit
55cd329ebd
25
Makefile
25
Makefile
@ -3,6 +3,9 @@
|
|||||||
#
|
#
|
||||||
# https://www.npmjs.com/package/fakefile
|
# 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.
|
# 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`
|
# It functions as a wrapper around the actual listed in `package.json`
|
||||||
# So instead of typing:
|
# So instead of typing:
|
||||||
@ -25,10 +28,26 @@
|
|||||||
# OSX users will have to install bash-completion
|
# OSX users will have to install bash-completion
|
||||||
# (http://davidalger.com/development/bash-completion-on-os-x-with-brew/)
|
# (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
|
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):
|
$$(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)
|
.PHONY: $$(TARGETS)
|
||||||
endef
|
endef
|
||||||
@ -37,4 +56,4 @@ $(eval $(call npm_script_targets))
|
|||||||
|
|
||||||
# These npm run scripts are available, without needing to be mentioned in `package.json`
|
# These npm run scripts are available, without needing to be mentioned in `package.json`
|
||||||
install:
|
install:
|
||||||
npm run install
|
$(INSTALLER)
|
||||||
|
@ -26,10 +26,8 @@
|
|||||||
"fsevents": "*"
|
"fsevents": "*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"cross-env": "3.1.3",
|
|
||||||
"fakefile": "0.0.8",
|
"fakefile": "0.0.8",
|
||||||
"next-update": "1.5.1",
|
"next-update": "1.5.1",
|
||||||
"npm-run-all": "3.1.2",
|
|
||||||
"replace": "0.3.0"
|
"replace": "0.3.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user