From aa298e0d20d2345f373026d2da2714278f5bf190 Mon Sep 17 00:00:00 2001 From: Nguyen Huu Thuong Date: Thu, 4 Mar 2021 20:32:58 +0100 Subject: [PATCH] minor fix: catch ';' --- .github/workflows/deploy.yml | 8 +++++--- app.py | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 29ca03b..051d141 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -24,14 +24,16 @@ jobs: with: host: ${{ secrets.DC_HOST }} user: ${{ secrets.DC_USER }} - pass: ${{ secrets.DC_PASS }} + key: ${{ secrets.DC_PASS }} port: ${{ secrets.DC_PORT }} connect_timeout: 10s first_ssh: |- rm -rf /home/github/test ls -la - echo $WELCOME - mkdir -p /home/github/test/test1 && + echo $WELCOME || + ls debug + mkdir -p /home/github/test/test1 && + ls debug mkdir -p /home/github/test/test2 && scp: |- './test/*' => /home/github/test/ diff --git a/app.py b/app.py index 34d8c55..f9c566c 100644 --- a/app.py +++ b/app.py @@ -80,8 +80,10 @@ def ssh_process(ssh, input_ssh): c = path.expandvars(commands[i]) if c == "": continue - if c.endswith('&&') or c.endswith('||') or c.endswith(';'): + if c.endswith('&&') or c.endswith('||'): c = c[0:-2] if i == (l-1) else c + elif c.endswith(';'): + c = c[0:-1] if i == (l-1) else c else: c = f"{c} &&" if i < (l-1) else c command_str = f"{command_str} {c}"