Skip to content

Commit d703e9e

Browse files
committed
evolve aws_china_mfa – part II
1 parent 8c0d0ce commit d703e9e

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

aws_china_mfa/aws_china_mfa.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,16 @@ main() {
158158

159159
set_credentials "$sourced" "$aws_profile" "$access_key" "$secret_key" "$session_token"
160160

161+
echo "" >&2
162+
echo "✓ Successfully authenticated to AWS China" >&2
163+
echo "" >&2
164+
161165
if [[ $sourced -eq 1 ]]; then
162-
echo "" >&2
163-
echo "✓ Successfully authenticated to AWS China" >&2
164-
echo "" >&2
165166
echo "Exported AWS credentials:" >&2
166167
echo "" >&2
167168
env | grep '^AWS_' | sort >&2
168-
else
169-
echo "" >&2
170-
echo "✓ Successfully authenticated to AWS China" >&2
171-
echo "" >&2
169+
elif [[ -t 1 ]]; then
170+
# stdout is a terminal (not piped to eval)
172171
echo "Copy and paste the export commands above to apply credentials." >&2
173172
fi
174173
}

0 commit comments

Comments
 (0)