UNPKG

loofah

Version:

Scrubs sensitive information from data

32 lines (25 loc) 1.13 kB
# usage: # `make build` or `make` compiles lib/*.coffee to lib/*.js (for all changed lib/*.coffee) # `make test` runs all the tests # `make testfile` runs just that test # `make clean` deletes all the compiled js files in lib-js TESTS=$(shell cd test && ls *.coffee | sed s/\.coffee$$//) LIBS=$(shell find . -regex "^./lib\/.*\.coffee\$$" | sed s/\.coffee$$/\.js/ | sed s/lib/lib-js/) build: clean $(LIBS) lib-js/%.js : lib/%.coffee node_modules/coffee-script/bin/coffee --bare -c -o $(@D) $(patsubst lib-js/%,lib/%,$(patsubst %.js,%.coffee,$@)) test: $(TESTS) $(TESTS): build NODE_ENV=test node_modules/mocha/bin/mocha -R spec --timeout 60000 --compilers coffee:coffee-script test/$@.coffee publish: clean build $(eval VERSION := $(shell grep version package.json | sed -ne 's/^[ ]*"version":[ ]*"\([0-9\.]*\)",/\1/p';)) @echo \'$(VERSION)\' $(eval REPLY := $(shell read -p "Publish and tag as $(VERSION)? " -n 1 -r; echo $$REPLY)) @echo \'$(REPLY)\' @if [[ $(REPLY) =~ ^[Yy]$$ ]]; then \ npm publish; \ git tag -a v$(VERSION) -m "version $(VERSION)"; \ git push --tags; \ fi clean: rm -rf lib-js