Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shell arg fix #380

Merged
merged 11 commits into from
Aug 10, 2021
12 changes: 7 additions & 5 deletions bin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ PREFIX="$(cd -P -- "${PREFIX}" && pwd)"
echo "Installing into ${PREFIX}" | sed "s#$HOME#~#g"

mkdir -p ${PREFIX}
releaseUrl=$(curl -sLI ${repo_url}/releases/latest | grep -e "location:.*tag" | cut -c11-)
releaseUrl=$(curl -sLI ${repo_url}/releases/latest | grep -ie "location:.*tag" | cut -c11-)
releaseTag=$(echo $releaseUrl | awk 'BEGIN{FS="/"}{print $8}' | tr -d '\r')
url=${repo_url}/releases/download/${releaseTag}/okta-aws-cli-${releaseTag:1}.jar
dest=${PREFIX}/$(basename ${url})
Expand All @@ -98,10 +98,10 @@ if ! grep '^#OktaAWSCLI' "${bash_functions}" &>/dev/null; then
cat <<'EOF' >>"${bash_functions}"
#OktaAWSCLI
function okta-aws {
withokta "aws --profile $1" "$@"
OKTA_PROFILE="$1" withokta "aws --profile $1" "${@:2}"
}
function okta-sls {
withokta "sls --stage $1" "$@"
OKTA_PROFILE="$1" withokta "sls --stage $1" "${@:2}"
}
EOF
fi
Expand All @@ -111,12 +111,14 @@ fishFunctionsDir="${PREFIX}/fish_functions"
mkdir -p "${fishFunctionsDir}"
cat <<'EOF' >"${fishFunctionsDir}/okta-aws.fish"
function okta-aws
withokta "aws --profile $argv[1]" $argv
set -lx OKTA_PROFILE "$argv[1]"
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
set -lx OKTA_PROFILE "$argv[1]"
withokta "sls --stage $argv[1]" $argv[2..-1]
end
EOF

Expand Down