diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-07-23 21:02:01 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-07-23 21:02:01 -0400 |
commit | 028660d87c41b7b5bb2f3e6004713bb7003cc03e (patch) | |
tree | 642f3cb7f2aa4a62be541c90180bca4d78b8ca54 | |
parent | 99ec5265e2e80ecca1252670657c50693da5254a (diff) | |
download | cmd2-git-028660d87c41b7b5bb2f3e6004713bb7003cc03e.tar.gz |
Fixed issue where some calls could have failed if the strings had spaces
-rw-r--r-- | cmd2/cmd2.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 7c2edac3..db8dcee2 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -3544,8 +3544,8 @@ class Cmd(cmd.Cmd): else: fobj.write('{}\n'.format(command.raw)) try: - self.do_edit(fname) - return self.do_run_script(fname) + self.do_edit(utils.quote_string_if_needed(fname)) + self.run_script(utils.quote_string_if_needed(fname)) finally: os.remove(fname) elif args.output_file: @@ -3852,7 +3852,7 @@ class Cmd(cmd.Cmd): file_path = args.file_path # NOTE: Relative path is an absolute path, it is just relative to the current script directory relative_path = os.path.join(self._current_script_dir or '', file_path) - return self.do_run_script(relative_path) + return self.do_run_script(utils.quote_string_if_needed(relative_path)) def _run_transcript_tests(self, transcript_paths: List[str]) -> None: """Runs transcript tests for provided file(s). |