Skip to content
This repository has been archived by the owner on Nov 17, 2022. It is now read-only.

Commit

Permalink
bugfix: replace echo with echo_out
Browse files Browse the repository at this point in the history
  • Loading branch information
trutvo committed Jun 21, 2018
1 parent 8a82896 commit 799e727
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions assume-role
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ assume-role(){

# load default assume-role profile if available, use "default" otherwise
if [ "$AWS_PROFILE_ASSUME_ROLE" ]; then
echo "Using assume-role default profile: $AWS_PROFILE_ASSUME_ROLE"
echo_out "Using assume-role default profile: $AWS_PROFILE_ASSUME_ROLE"
default_profile=${AWS_PROFILE_ASSUME_ROLE}
else
default_profile="default"
Expand All @@ -100,7 +100,7 @@ assume-role(){

# set account_name
if [ -z "$account_name_input" ] && [ -z "$OUTPUT_TO_EVAL" ]; then
echo -n "Assume Into Account [default]:"
echo_out -n "Assume Into Account [default]:"
read -r account_name
# default
account_name=${account_name:-"default"}
Expand All @@ -126,7 +126,7 @@ assume-role(){

# set role
if [ -z "$role_input" ] && [ -z "$OUTPUT_TO_EVAL" ]; then
echo -n "Assume Into Role [read]: "
echo_out -n "Assume Into Role [read]: "
read -r role
role=${role:-"read"}
else
Expand All @@ -141,7 +141,7 @@ assume-role(){
# set region
AWS_CONFIG_REGION="$(aws configure get region --profile ${default_profile})"
if [ -z "$aws_region_input" ] && [ -z "$AWS_REGION" ] && [ -z "$AWS_DEFAULT_REGION" ] && [ -z "$AWS_CONFIG_REGION" ] && [ -z "$OUTPUT_TO_EVAL" ]; then
echo -n "Assume Into Region [us-east-1]: "
echo_out -n "Assume Into Region [us-east-1]: "
read -r region
region=${region:-"us-east-1"}
elif [ ! -z "$aws_region_input" ]; then
Expand Down Expand Up @@ -178,7 +178,7 @@ assume-role(){
if [ "$ABOUT_SESSION_TIMEOUT" -lt "$SESSION_TIMEOUT_DELTA" ]; then
# We'll need a token to renew session
if [ -z "$mfa_token_input" ] && [ -z "$OUTPUT_TO_EVAL" ]; then
echo -n "MFA Token: "
echo_out -n "MFA Token: "
read -r -s mfa_token
else
mfa_token="$mfa_token_input"
Expand Down Expand Up @@ -302,7 +302,7 @@ if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
elif [[ "init" == "${1}" ]]; then
# TODO: This will be multi-shell support like rbenv, e.g. fish
# Supports `eval "$(assume-role init -)"` in rc file
echo "Currently not supported"
echo_out "Currently not supported"
else
# The script is being called directly
# Supports calling being called like eval $(assume-role account role [token])
Expand Down

0 comments on commit 799e727

Please sign in to comment.