1. dubcanada
  2. SCons


anatoly techtonik  committed aea12b7

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

  • Participants
  • Parent commits bcfed9d
  • Branches default

Comments (0)

Files changed (1)

File src/script/scons.bat

View file
 @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%" %*
 if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto returncode