Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yixiaoer committed Jul 3, 2024
1 parent 2889348 commit 1c158a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authors = [
{ name="Shin", email="[email protected]" },
]
# we cannot use `dynamic` here, because it doesn't work on Python 3.8
version = "0.1.5"
version = "0.1.6"
dependencies = [
"psutil",
"fabric",
Expand Down
6 changes: 5 additions & 1 deletion src/tpux/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ def get_podips() -> List[str]:
return [line.rstrip('\n') for line in f]

def run_command_on_localhost(command: str, **kwargs) -> None:
result = subprocess.run(command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env, **kwargs)
if kwargs.get('shell'):
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env, **kwargs)
else:
result = subprocess.run(command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env, **kwargs)

if result.returncode != 0:
print(f'Command failed: {command}')
print(f'Error: {result.stderr.decode()}')
Expand Down

0 comments on commit 1c158a5

Please sign in to comment.