From 991281b8cb6480c6a74960326311bf60b07f94fc Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Tue, 5 May 2020 00:55:38 +0200 Subject: [PATCH] Make the directory persistent --- markdownrunner.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/markdownrunner.py b/markdownrunner.py index 1c39010..7566808 100755 --- a/markdownrunner.py +++ b/markdownrunner.py @@ -15,6 +15,7 @@ from typing import * # Usage: $0 remote.host.name md1 ... host: str +directory: str = None def main(): if len(sys.argv) < 3: @@ -63,7 +64,7 @@ def parse_snippet(s: Tuple[str, str]) -> Sequence[Command]: # We now check the separate lines and possibly tweak them (e.g. by removing sudo-s) lines = s[1].split('\n') - directory = None # Don't cd by default + global directory result = [] for line in lines: user = None # This allows (in conjunction with the right order of arguments to 'ssh') to specify the default user in the hostname (as 'user@host.name')