Merge pull request 'fix removing quotes' (#40) from p4u1/backup-bot-two:fix-quotes into main
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
Reviewed-on: #40
This commit is contained in:
commit
4befebba38
|
@ -139,7 +139,7 @@ def run_commands(commands):
|
|||
command = command.removeprefix('bash -c').removeprefix('sh -c')
|
||||
# Remove quotes surrounding the command
|
||||
if (len(command) >= 2 and command[0] == command[-1] and (command[0] == "'" or command[0] == '"')):
|
||||
command[1:-1]
|
||||
command = command[1:-1]
|
||||
# Use bash's pipefail to return exit codes inside a pipe to prevent silent failure
|
||||
command = f"bash -c 'set -o pipefail;{command}'"
|
||||
logging.info(f"run command in {container.name}:")
|
||||
|
|
Loading…
Reference in New Issue