Compare commits

...

3 Commits

Author SHA1 Message Date
Nguyen Huu Thuong 78e864b489 Merge branch 'master' into latest
# Please enter a commit message to explain why this merge is necessary,
2021-03-05 12:33:13 +01:00
Nguyen Huu Thuong 6582a0be19 Merge branch 'master' into latest 2021-03-04 20:35:11 +01:00
Nguyen Huu Thuong aa298e0d20 minor fix: catch ';' 2021-03-04 20:32:58 +01:00
2 changed files with 8 additions and 4 deletions

View File

@ -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
echo $WELCOME ||
ls debug
mkdir -p /home/github/test/test1 &&
ls debug
mkdir -p /home/github/test/test2 &&
scp: |-
'./test/*' => /home/github/test/

4
app.py
View File

@ -86,8 +86,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}"