Skip to content

Commit

Permalink
Strip leading and trailing whitespace from path inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
OLILHR committed Sep 28, 2024
1 parent c7d9415 commit 744b958
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions chonk/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def path_prompt(message: str, default: str, exists: bool = False) -> str:

while True:
path: str = prompt(f"{message} ", default=default, completer=path_completer)
path = path.strip() # # remove leading and trailing whitespace
full_path: str = os.path.abspath(os.path.expanduser(path))
if not exists or os.path.exists(full_path):
return full_path
Expand Down

0 comments on commit 744b958

Please sign in to comment.