Made .bat file dynamically created again since it requires an absolute path.

This commit is contained in:
Griatch 2015-02-02 20:54:26 +01:00
parent 5a7866d572
commit 2fe2aa6db7
4 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,9 @@
#! /usr/bin/python2.7
"""
Linux launcher
This is copied directly into the python bin directory and makes the
'evennia' program available on $PATH.
"""
import os, sys

View File

@ -1 +0,0 @@
@"python" "evennia.py" %*

View File

@ -1,6 +1,7 @@
#! /usr/bin/python2.7
"""
Linux launcher
Windows launcher. This is called by a dynamically created .bat file in
the python bin directory and makes the 'evennia' program available on
the command %path%.
"""
import os, sys

View File

@ -27,7 +27,10 @@ def get_scripts():
this means creating a .bat file.
"""
if os.name == "nt":
return [os.path.join("bin", "windows", "evennia.bat"), os.path.join("bin", "windows", "evennia.py")]
batpath = os.path.join("bin", "windows", "evennia.bat")
with open(batpath, "w") as batfile:
batfile.write("@\"%s\" \"%s\" %%*" % (sys.executable, batpath))
return [batpath]
else:
return [os.path.join("bin", "unix", "evennia")]