bin/tahoe-script.template: On non-Windows, invoke support/bin/tahoe directly as a script (rather than via python), so that 'top' for example will show it as 'tahoe'. On Windows, simplify some code that set argv[0], which is never used. fixes #174

This commit is contained in:
david-sarah 2010-11-27 15:26:50 -08:00
parent e62a69e7ff
commit 9815852a09

View File

@ -72,22 +72,21 @@ if sys.platform == "win32":
if not arg.startswith(u"-") or arg == u"-":
break
argv = argv[1:]
if arg == u'-m':
# sys.argv[0] should really be the absolute path of the module source, but never mind
break
if arg == u'-c':
argv[0] = u'-c'
if arg == u'-m' or arg == u'-c':
break
local_tahoe = "Scripts\\tahoe.pyscript"
script = os.path.join(base, "support", "Scripts", "tahoe.pyscript")
# On Windows, the script is not directly executable and must be run via python.
args = [sys.executable, script] + argv[1:]
else:
argv = sys.argv
local_tahoe = "bin/tahoe"
script = os.path.join(base, "support", "bin", "tahoe")
script = os.path.join(base, "support", local_tahoe)
# On non-Windows, invoke the script directly, so that 'top' for example shows 'tahoe'.
args = [script] + sys.argv[1:]
try:
res = subprocess.call([sys.executable, script] + argv[1:], env=os.environ)
res = subprocess.call(args, env=os.environ)
except (OSError, IOError), le:
if le.args[0] == errno.ENOENT:
print whoami