我安装了nodejs,希望为scons添加bin目录:
import os
env=Environment()
env.PrependENVPath('PATH','/home/my/node/bin')
print "PATH is", env.subst('$PATH')
运行scons,输出:
路径不打印任何值。为什么呢?
更改为以下内容以查看PrependEnvPath的结果
import os
env=Environment()
env.PrependENVPath('PATH','/home/my/node/bin')
print("PATH is", env['ENV']['$PATH'])
收益率:
$ scons.py
scons: Reading SConscript files ...
PATH is:/home/my/node/bin:/opt/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin
scons: done reading SConscript files.
scons: Building targets ...
scons: `.' is up to date.
scons: done building targets.