bincmd.py 455 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env python
  2. # DT Home
  3. # Bin Command
  4. #
  5. # Douglas Thrift
  6. #
  7. # bincmd.py
  8. import os.path
  9. import subprocess
  10. import sys
  11. _bin = os.path.join(os.path.dirname(os.path.dirname(subprocess.check_output('where git'))), 'bin')
  12. def cmd(command, args = None):
  13. if args is None:
  14. args = sys.argv[1:]
  15. exe = os.path.join(_bin, "%s.exe" % command)
  16. assert os.path.isfile(exe)
  17. sys.exit(subprocess.call([command] + args, executable = exe))