Move creation of pycygrun into the install script

This commit is contained in:
Kovid Goyal
2015-12-07 13:20:21 +05:30
parent ad4f4b65fe
commit 906dd4305f
2 changed files with 12 additions and 15 deletions
+11
View File
@@ -9,6 +9,7 @@ import re
import shutil
import os
import glob
import stat
known_extensions = {
'bz2.pyd',
@@ -128,6 +129,16 @@ def main():
if num != 1:
raise SystemExit('Failed to patch mimetypes.py')
f.write(raw)
pycgrun = os.path.join(install_dir, 'pycygrun')
with open(pycgrun, 'wb') as f:
f.write(b'''\
#!/bin/zsh
SCRIPT=$(readlink -f $0)
SCRIPTPATH=`dirname $SCRIPT`
PYSCRIPT=`cygpath -w $1`
exec $SCRIPTPATH/python.exe $PYSCRIPT ${@:2}
''')
os.chmod(pycgrun, stat.S_IRWXU)
print('python installed to:', install_dir)