我想更改此Makefile:
SHELL := /bin/bash
PATH := node_modules/.bin:$(PATH)
boot:
@supervisor \
--harmony \
--watch etc,lib \
--extensions js,json \
--no-restart-on error \
lib
test:
NODE_ENV=test mocha \
--harmony \
--reporter spec \
test
clean:
@rm -rf node_modules
.PHONY: test clean
至:
SHELL := /bin/bash
PATH := node_modules/.bin:$(PATH)
boot:
@supervisor \
--harmony \
--watch etc,lib \
--extensions js,json \
--no-restart-on error \
lib
test: NODE_ENV=test
test:
mocha \
--harmony \
--reporter spec \
test
clean:
@rm -rf node_modules
.PHONY: test clean
不幸的是,第二个命令不起作用(节点进程仍使用default运行NODE_ENV
。
我错过了什么?
默认情况下,make变量不会导出到进程make invokes的环境中。但是,您可以使用make export
强制他们这样做。更改:
test: NODE_ENV = test
对此:
test: export NODE_ENV = test
(假设您具有足够现代的GNU make> = 3.77版本)。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句