Skip to content

Commit

Permalink
fix: Allow named URLs which support args be used without them
Browse files Browse the repository at this point in the history
  • Loading branch information
bbugyi200 committed Aug 29, 2024
1 parent 154ba2a commit 8742eed
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/zorg/app/runners/_run_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def _open_rid_link(cfg: OpenActionConfig, rid_link: str) -> int:

def _open_url_link(cfg: OpenActionConfig, url_link: str) -> int:
id_ = url_link[2:-1]
x_arg: Optional[str] = None
x_arg = ""
if ":" in id_:
id_, x_arg = id_.split(":")
notes = note_utils.get_notes_by_id(
Expand Down Expand Up @@ -269,9 +269,7 @@ def _open_url_link(cfg: OpenActionConfig, url_link: str) -> int:
)
return 1

x_link = c.get_only_item(x_links)
if x_arg:
x_link = x_link.replace("%s", x_arg).replace("%", "%20")
x_link = c.get_only_item(x_links).replace("%s", x_arg).replace("%", "%20")
print(f"ECHO Opening in browser: {x_link}")
proc = sp.run(["open", x_link], check=True)
return proc.returncode
Expand Down

0 comments on commit 8742eed

Please sign in to comment.