Last active
December 14, 2015 13:29
-
-
Save sherbang/5093976 to your computer and use it in GitHub Desktop.
Use this to make files in IronPython\Scripts executable from the windows command prompt. Add IronPython and Scripts folders to PATH then run "update_scripts C:\Program Files\IronPython 2.7\Scripts".
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@setlocal enabledelayedexpansion && ipy -x "%~f0" %*& exit /b !ERRORLEVEL! | |
import os | |
import sys | |
scripts_dir = sys.argv[1] | |
scripts = os.listdir(scripts_dir) | |
for script in scripts: | |
if script.endswith('.cmd'): | |
continue | |
script_path = os.path.join(scripts_dir, script) | |
with open(script_path + '.cmd', 'w') as f: | |
f.write('@echo off\r\n') | |
f.write('"%s" "%s" %%*\r\n' % (sys.executable, script_path)) | |
f.write('exit /b !ERRORLEVEL!\r\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment