@ prefix when setting environment variable in Makefile

前端 未结 1 448
你的背包
你的背包 2020-12-03 14:49

Here is what I\'ve got so far:

SPECS = $(shell find spec -iname \"*_spec.js\")

spec:
    @NODE_ENV=test \\
    @NODE_PATH=lib \\
    ./node_modules/.bin/ex         


        
相关标签:
1条回答
  • 2020-12-03 15:09

    Use '@' only once. It is only needed at the very beginning of the string, but you have it twice. The line continuations are very literal, and your current code reads:

    @NODE_ENV=test @NODE_PATH=lib ./node_modules/.bin/expresso $(TESTFLAGS) $(SPECS)
    

    The '@' on NODE_PATH is getting passed to the shell, which you do not want.

    0 讨论(0)
提交回复
热议问题