Skip to content

Commit

Permalink
fix user/host-less specs in combination with python specs
Browse files Browse the repository at this point in the history
  • Loading branch information
luto committed Jan 20, 2025
1 parent 908a519 commit 8cdeab5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/shellinspector/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ def parse_commands(specfile: Specfile, commands: str) -> None:
cmd
for cmd in reversed(specfile.commands)
if cmd.execution_mode == execution_mode
or execution_mode == ExecutionMode.PYTHON
)
user = user or last_command.user
host = host or last_command.host
Expand Down
7 changes: 5 additions & 2 deletions tests/e2e/700_python.ispec
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[test@remote]! set_env("did_python_run", "it did")
[test@remote]$ true
# reuse user/host from above
! set_env("did_python_run", "it did")
[root@remote]! set_env("did_python_run", "or did it")
! set_env("did_python_run", "or did it?")
[test@remote]$ echo $did_python_run
it did
[root@remote]$ echo $did_python_run
or did it
or did it?

0 comments on commit 8cdeab5

Please sign in to comment.