Skip to content

Commit

Permalink
Verify if script name provided is a file before running it
Browse files Browse the repository at this point in the history
  • Loading branch information
dukecat0 committed Dec 18, 2023
1 parent f0192ec commit 159c244
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## dev

- [docs] Add Scoop installation instructions
- `pipx run`: Verify whether the script name provided is a file before running it

## 1.3.3

Expand Down
2 changes: 1 addition & 1 deletion src/pipx/commands/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def maybe_script_content(app: str, is_path: bool) -> Optional[str]:

# Look for a local file first.
app_path = Path(app)
if app_path.exists():
if app_path.exists() and app_path.is_file():
return app_path.read_text(encoding="utf-8")
elif is_path:
raise PipxError(f"The specified path {app} does not exist")
Expand Down

0 comments on commit 159c244

Please sign in to comment.