Skip to content

Commit

Permalink
Expand the tilde
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Jul 30, 2024
1 parent 07b6b49 commit 528b7c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cli/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ requires = [

[project]
name = "traduire-cli"
version = "0.0.4"
version = "0.0.5"
description = "Traduire CLI"
readme = "README.md"
authors = [
Expand Down
5 changes: 3 additions & 2 deletions cli/trd.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ def current_project():
_terminate(f"Config file {config} doesn't exist.")

data = tomllib.loads(config.read_text())
cwd = str(Path.cwd()).rstrip("/")
cwd = Path.cwd()

for project in data.get("project", ()):
if project["path"].rstrip("/") == cwd:
path = Path(project["path"]).expanduser()
if path == cwd:
return project

_terminate(f"Couldn't find a project for the current working directory {cwd}") # noqa: RET503
Expand Down

2 comments on commit 528b7c2

@matthiask
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Loscho19 Funktioniert jetzt auch mit Tilde.

@Loscho19
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Danke

Please sign in to comment.