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 |
|
||||
+----------------+------+-----------+---------------------------+
|
||||
"""
|
||||
PARSE_WITH_ARGUMENTS = {"script"}
|
||||
|
||||
script: Text
|
||||
|
||||
|
@ -44,9 +45,10 @@ class ScriptAction(Action):
|
|||
|
||||
If no shebang is defined, :any:`ScriptAction.DEFAULT_SHEBANG` with be used.
|
||||
"""
|
||||
if not self.parameters.script.startswith("#!"):
|
||||
return f"{self.DEFAULT_SHEBANG}{os.linesep}{self.parameters.script}"
|
||||
return self.parameters.script
|
||||
script = self.parsed_parameters["script"]
|
||||
if not script.startswith("#!"):
|
||||
return f"{self.DEFAULT_SHEBANG}{os.linesep}{script}"
|
||||
return script
|
||||
|
||||
def execute(self, **kwargs):
|
||||
workspace = kwargs.get("workspace")
|
||||
|
|
Reference in New Issue