0.0.1 • Published 7 years ago

makefile-assert v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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 1

But 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-assert
npm install --save makefile-assert

Usage

To use it, include this module's Makefile in your own...

ifneq ($(wildcard ./node_modules),)
  include ./node_modules/makefile-assert/Makefile
endif

And then you can add the assert-% as a prerequisite to your other targets...

target: assert-VARIABLE