Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix -o flag not working if path has whitespace around it #670

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tagstudio/src/core/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def evaluate_path(self, open_path: str | None) -> LibraryStatus:
"""Check if the path of library is valid."""
library_path: Path | None = None
if open_path:
library_path = Path(open_path)
library_path = Path(open_path).expanduser()
if not library_path.exists():
logger.error("Path does not exist.", open_path=open_path)
return LibraryStatus(success=False, message="Path does not exist.")
Expand Down
2 changes: 1 addition & 1 deletion tagstudio/src/qt/ts_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def create_folders_tags_modal():
self.init_library_window()
self.migration_modal: JsonMigrationModal = None

path_result = self.evaluate_path(self.args.open)
path_result = self.evaluate_path(str(self.args.open).lstrip().rstrip())
# check status of library path evaluating
if path_result.success and path_result.library_path:
self.splash.showMessage(
Expand Down
Loading