diff options
author | Anatoly Techtonik <techtonik@gmail.com> | 2011-04-16 07:55:06 (GMT) |
---|---|---|
committer | Anatoly Techtonik <techtonik@gmail.com> | 2011-04-16 07:55:06 (GMT) |
commit | 5d90a3b7becb500b3fd380f9a54a60e124af26ab (patch) | |
tree | b82661da3cf5045025117e8f996e9d5f0baeeb1f | |
parent | f52c783c433a98961f6ed5baaf56ee527f2dc71c (diff) | |
download | SCons-5d90a3b7becb500b3fd380f9a54a60e124af26ab.zip SCons-5d90a3b7becb500b3fd380f9a54a60e124af26ab.tar.gz SCons-5d90a3b7becb500b3fd380f9a54a60e124af26ab.tar.bz2 |
make .bat files execute .py script with the same name instead of trying to set sys.path inline
it is a final fix for issue #2051 to make SCons easy_installable on Windows
-rw-r--r-- | src/script/scons.bat | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/script/scons.bat b/src/script/scons.bat index f0ffa9a..b3f2dc2 100644 --- a/src/script/scons.bat +++ b/src/script/scons.bat @@ -17,7 +17,10 @@ goto endscons setlocal
@REM ensure the script will be executed with the Python it was installed for
set path=%~dp0;%~dp0..;%path%
-python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-__VERSION__'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-__VERSION__'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %*
+@REM try the script named as the .bat file in current dir, then in Scripts subdir
+set scriptname=%~dp0%~n0.py
+if not exist %scriptname% set scriptname=%~dp0Scripts\%~n0.py
+python "%scriptname%" %*
endlocal & set SCONS_ERRORLEVEL=%ERRORLEVEL%
if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto returncode
|