contrib/script: Allow parameters
This commit is contained in:
parent
a01645a1c8
commit
f3b5235658
|
@ -35,6 +35,7 @@ class ScriptAction(Action):
|
||||||
| ``script`` | text | yes | The script to be executed |
|
| ``script`` | text | yes | The script to be executed |
|
||||||
+----------------+------+-----------+---------------------------+
|
+----------------+------+-----------+---------------------------+
|
||||||
"""
|
"""
|
||||||
|
PARSE_WITH_ARGUMENTS = {"script"}
|
||||||
|
|
||||||
script: Text
|
script: Text
|
||||||
|
|
||||||
|
@ -44,9 +45,10 @@ class ScriptAction(Action):
|
||||||
|
|
||||||
If no shebang is defined, :any:`ScriptAction.DEFAULT_SHEBANG` with be used.
|
If no shebang is defined, :any:`ScriptAction.DEFAULT_SHEBANG` with be used.
|
||||||
"""
|
"""
|
||||||
if not self.parameters.script.startswith("#!"):
|
script = self.parsed_parameters["script"]
|
||||||
return f"{self.DEFAULT_SHEBANG}{os.linesep}{self.parameters.script}"
|
if not script.startswith("#!"):
|
||||||
return self.parameters.script
|
return f"{self.DEFAULT_SHEBANG}{os.linesep}{script}"
|
||||||
|
return script
|
||||||
|
|
||||||
def execute(self, **kwargs):
|
def execute(self, **kwargs):
|
||||||
workspace = kwargs.get("workspace")
|
workspace = kwargs.get("workspace")
|
||||||
|
|
Reference in New Issue