0.0.1 • Published 9 years ago
makefile-assert v0.0.1
makefile-assert
An easy way to assert that an environment variable is defined in your Node.js project's Makefile.
Example
For a makefile like...
ifneq ($(wildcard ./node_modules),)
include ./node_modules/makefile-assert/Makefile
endif
deploy: assert-VERSION
@ ./node_modules/.bin/np $(VERSION)Running make deploy by itself will print out...
$ make deploy
Error: You must pass in the `VERSION` environment variable.
make: *** [assert-VERSION] Error 1But if you set the VERSION variable, it will work just fine...
$ make deploy VERSION=2.0.0
Deploying version 2.0.0 ...Installation
yarn add makefile-assertnpm install --save makefile-assertUsage
To use it, include this module's Makefile in your own...
ifneq ($(wildcard ./node_modules),)
include ./node_modules/makefile-assert/Makefile
endifAnd then you can add the assert-% as a prerequisite to your other targets...
target: assert-VARIABLE0.0.1
9 years ago