Skip to content

Commit

Permalink
🐛 Fixes shell arguments being passed twice to aws command
Browse files Browse the repository at this point in the history
Removes first param from arg lists before calling aws cli. Fixes both bash and fish

Resolves: oktadev#375, oktadev#376
  • Loading branch information
hcourse-nydig committed Aug 4, 2021
1 parent 2f3a60a commit 01fe0ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ if ! grep '^#OktaAWSCLI' "${bash_functions}" &>/dev/null; then
cat <<'EOF' >>"${bash_functions}"
#OktaAWSCLI
function okta-aws {
withokta "aws --profile $1" "$@"
withokta "aws --profile $1" "${@:2}"
}
function okta-sls {
withokta "sls --stage $1" "$@"
withokta "sls --stage $1" "${@:2}"
}
EOF
fi
Expand All @@ -111,12 +111,12 @@ fishFunctionsDir="${PREFIX}/fish_functions"
mkdir -p "${fishFunctionsDir}"
cat <<'EOF' >"${fishFunctionsDir}/okta-aws.fish"
function okta-aws
withokta "aws --profile $argv[1]" $argv
withokta "aws --profile $argv[1]" $argv[2..-1]
end
EOF
cat <<'EOF' >"${fishFunctionsDir}/okta-sls.fish"
function okta-sls
withokta "sls --stage $argv[1]" $argv
withokta "sls --stage $argv[1]" $argv[2..-1]
end
EOF

Expand Down

0 comments on commit 01fe0ea

Please sign in to comment.