runscript: set sys.argv to remaining arguments (#3015)
This commit is contained in:
parent
1ec749e773
commit
bbaae634e4
|
@ -41,6 +41,7 @@ class CmdRunScript(Command):
|
|||
fullpath = os.path.dirname(os.path.abspath(args[0]))
|
||||
sys.path.append(fullpath)
|
||||
module_name = os.path.splitext(os.path.basename(args[0]))[0]
|
||||
sys.argv = args[1:]
|
||||
runpy.run_module(module_name)
|
||||
|
||||
CmdRunScript.register()
|
||||
|
|
Loading…
Reference in New Issue