Skip to content

Commit 8f4e825

Browse files
committed
Fix a missed instance of replacing ~/.aws with GEODESIC_AWS_HOME
1 parent 60b6b6f commit 8f4e825

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rootfs/etc/profile.d/aws.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/bin/bash
2+
# shellcheck disable=SC2155
3+
# Above directive suppresses ShellCheck SC2155: Declare and assign separately to avoid masking return values.
4+
# In this script, we do not care about return values, as problems are detected by the resulting empty value.
25

36
export AWS_REGION_ABBREVIATION_TYPE=${AWS_REGION_ABBREVIATION_TYPE:-fixed}
47
export AWS_DEFAULT_SHORT_REGION=${AWS_DEFAULT_SHORT_REGION:-$(aws-region --${AWS_REGION_ABBREVIATION_TYPE} ${AWS_DEFAULT_REGION:-us-west-2})}
@@ -252,7 +255,7 @@ function refresh_current_aws_role_if_needed() {
252255
local is_exported="^declare -[^ x]*x[^ x]* "
253256
local aws_profile=$(declare -p AWS_PROFILE 2>/dev/null)
254257
[[ $aws_profile =~ $is_exported ]] || aws_profile=""
255-
local credentials_mtime=$(stat -c "%Y" ${AWS_SHARED_CREDENTIALS_FILE:-"~/.aws/credentials"} 2>/dev/null)
258+
local credentials_mtime=$(stat -c "%Y" ${AWS_SHARED_CREDENTIALS_FILE:-"${GEODESIC_AWS_HOME}/credentials"} 2>/dev/null)
256259
local role_fingerprint="${aws_profile}/${credentials_mtime}/${AWS_ACCESS_KEY_ID}"
257260
if [[ $role_fingerprint != $GEODESIC_AWS_ROLE_CACHE ]]; then
258261
export_current_aws_role

0 commit comments

Comments
 (0)