Browse Source

minimal to run installers

jmelesky 7 years ago
parent
commit
43bdc507f4
1 changed files with 42 additions and 0 deletions
  1. 42 0
      punt

+ 42 - 0
punt

@@ -0,0 +1,42 @@
+#!/usr/bin/env python3
+
+from subprocess import check_call
+from os import environ
+from copy import deepcopy
+from pathlib import Path
+
+
+import argparse
+
+
+wine = '/usr/bin/wine'
+bottledir = Path(Path.home(), '.punt/bottles')
+bottledir.mkdir(parents=True, exist_ok=True)
+
+
+# minimum start:
+#
+#   $ punt install bleh.exe
+#
+
+
+def run(bottle, exe):
+    newdir = bottledir / bottle
+    newenv = deepcopy(environ)
+    newenv.update({'WINEPREFIX': str(newdir)})
+    check_call([wine, exe], env=newenv)
+
+
+
+
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser(description="Command-line tool for using and manipulating wine 'bottle's")
+    parser.add_argument('command', help="the subcommand to run")
+    parser.add_argument('bottle', help="the name of the bottle")
+    parser.add_argument('app', help="the path to the windows executable to run")
+    args = parser.parse_args()
+
+    run(args.bottle, args.app)
+
+
+