diff --git a/common/bin/pass-otp b/common/bin/pass-otp index 92f9a1d..023a8d3 100755 --- a/common/bin/pass-otp +++ b/common/bin/pass-otp @@ -5,7 +5,7 @@ key="$1"; shift args=("$@") -otp="$(set -e; pass "$key" 2>/dev/null | grep -Pi '^otp.*: ?.*$' | cut -d ':' -f 2 | sed 's/ //g')" +otp="$(set -e; pass "$key" 2>/dev/null | grep -Pi '^otp' | cut -d ':' -f 2 | sed 's/ //g')" otp_status="$?" [[ $otp_status != 0 ]] && { echo "pass command failed with exit code $otp_status"; exit 1; } [[ -z $otp ]] && { echo "No OTP secret found for pass entry '$key'"; exit 2; } diff --git a/common/fish/config.fish b/common/fish/config.fish index f3fa1b2..3604a90 100755 --- a/common/fish/config.fish +++ b/common/fish/config.fish @@ -40,6 +40,15 @@ function fish_greeting; test -f /proc/sys/kernel/pty/nr && printf "%6d PTYs open\n" (cat /proc/sys/kernel/pty/nr) end +if has_command brew && test -f (brew --prefix asdf)/lib/asdf.fish + set -Ux ASDF_DIR (brew --prefix asdf) + source (brew --prefix asdf)/lib/asdf.fish +else if test -f $HOME/.asdf/asdf.fish + source $HOME/.asdf/asdf.fish +else if test -f /opt/asdf-vm/asdf.fish + source /opt/asdf-vm/asdf.fish +end + # assume the user uses "$HOME" to just store their mess of dotfiles and other # nonsense that clutters it up and that they have a preferred starting # directory where they keep the stuff they actually care about @@ -47,9 +56,3 @@ end if test $PWD = $HOME; or test $PWD = $NICE_HOME; cd $NICE_HOME || cd end - -if test -f $HOME/.asdf/asdf.fish - source $HOME/.asdf/asdf.fish -else if test -f /opt/asdf-vm/asdf.fish - source /opt/asdf-vm/asdf.fish -end diff --git a/common/fish/paths.fish b/common/fish/paths.fish index bc5df33..a720dbd 100755 --- a/common/fish/paths.fish +++ b/common/fish/paths.fish @@ -2,7 +2,7 @@ set -Ux GOPATH $HOME/.go -set -g fish_user_paths \ +set paths_candidates \ $HOME/.go \ $GOPATH/bin \ $DOTFILES_PATH/common/bin \ @@ -12,7 +12,7 @@ set -g fish_user_paths \ $HOME/.yarn/bin \ $HOME/.netlify/helper/bin -for d in $ENV_PATH/*/bin +for d in $paths_candidates $ENV_PATH/*/bin test -d $d && set -ga fish_user_paths $d end