Skip to content

Commit

Permalink
more idiomatic plumbum usage
Browse files Browse the repository at this point in the history
  • Loading branch information
nikvdp committed Sep 6, 2023
1 parent 1056c40 commit 7b839f5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions agentgrunt/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,15 @@ def bundle(
print(final_msg)
print(f"---\n{gpt_prompt}\n---")

if interactive and shutil.which("pbcopy"):
if interactive and local.which("pbcopy"):
# prompt user if they want to copy it and reveal the file, then do it if they say yes

copy = (
True if assume_yes else typer.confirm("Copy the message to your clipboard?")
)
if copy:
pbcopy = local["pbcopy"]
echo = local["echo"]
(echo[gpt_prompt] | pbcopy)()
(pbcopy << gpt_prompt)()
open_finder = (
True if assume_yes else typer.confirm("Reveal the file in Finder?")
)
Expand Down

0 comments on commit 7b839f5

Please sign in to comment.