2016-10-05 8 views
0

私はnodejsをインストールし、sconsのためにbinディレクトリを追加したいと考えています:sconsの実行env.PrependENVPath/AppendENVPathのdoesntの仕事:

import os 
env=Environment() 
env.PrependENVPath('PATH','/home/my/node/bin') 
print "PATH is", env.subst('$PATH') 

、それは印刷します

PATHはありませんまあ です値が出力されます。何故ですか?

+0

の可能性のある重複(HTTP [どのように私はsconsのでクロスコンパイラを使用することができますか?]: //stackoverflow.com/questions/23898584/how-can-i-use-a-cross-compiler-with-scons) –

+0

ヒント: 'env ['PATH']!= env ['ENV'] ['PATH' ] ' –

答えて

1

あなた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. 
関連する問題