Skip to content

Commit

Permalink
fix(fish): gh auth properly ignore gh token
Browse files Browse the repository at this point in the history
  • Loading branch information
scottames committed Aug 10, 2024
1 parent 4079671 commit ba7de3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion home/private_dot_config/fish/custom_functions.d/aqua.fish
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ function aqua \
--description "Declarative CLI Version manager. Runs behind op, if installed for GitHub API auth." \
--wraps aqua

set -l _KEYRING_AUTH (command gh auth status | grep 'keyring' | grep '✓ Logged in')
set -l _KEYRING_AUTH (GITHUB_TOKEN="" command gh auth status | grep 'keyring' | grep '✓ Logged in')
if [ $_KEYRING_AUTH ]
set -e GITHUB_TOKEN
set -l GITHUB_TOKEN (gh auth token)

command aqua $argv
Expand Down
4 changes: 2 additions & 2 deletions home/private_dot_config/fish/custom_functions.d/gh.fish
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ function gh \
--description "GitHub CLI. Runs behind op, if installed for GitHub API auth." \
--wraps gh

set -l _KEYRING_AUTH (command gh auth status | grep 'keyring' | grep '✓ Logged in')
set -l _KEYRING_AUTH (GITHUB_TOKEN="" command gh auth status | grep 'keyring' | grep '✓ Logged in')
if [ $_KEYRING_AUTH ]
set -x GITHUB_TOKEN
set -e GITHUB_TOKEN

command gh $argv
else if [ $HAS_OP ]
Expand Down

0 comments on commit ba7de3c

Please sign in to comment.