Skip to content

Commit

Permalink
secret: fix secret env -- usage
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Dec 18, 2023
1 parent 10eab80 commit 19bb29b
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions commands/secret
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ function secret_() (
'--no-quiet'* | '--quiet'* | '--no-verbose'* | '--verbose'*) ;; # handled by is-quiet-enabled
'signin') action='login' ;;
'signout') action='logout' ;;
'--')
args+=("$@")
shift $#
break
;;
*)
if test -z "$action"; then
action="$item"
Expand Down Expand Up @@ -734,20 +739,24 @@ function secret_() (
}

function secret_env {
local before=() after=() found='no' args arg
local before=() after=() found='no' args item
local keys key value
local env_secrets env_args env_arg

for arg in "$@"; do
if test "$arg" = '--'; then
while test "$#" -ne 0; do
item="$1"
shift
case "$item" in
'--')
found='yes'
continue
fi
if test "$found" = 'yes'; then
after+=("$arg")
else
before+=("$arg")
fi
after+=("$@")
shift $#
break
;;
*)
before+=("$item")
;;
esac
done

if test "$found" = 'yes' && is-array-full "${before[@]}" && is-array-full "${after[@]}"; then
Expand Down

0 comments on commit 19bb29b

Please sign in to comment.