Skip to content

Commit 28b8b97

Browse files
authored
Validate of profile has multiple directories and create them (#234)
1 parent 11f5a5d commit 28b8b97

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/scripts/assume_role_with_web_identity.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
#shellcheck disable=SC1090
33

44
# Ensure variables are loaded from $BASH_ENV as required
@@ -82,6 +82,10 @@ elif [ "${AWS_CLI_BOOL_SET_AWS_ENV_VARS}" = 1 ]; then
8282
echo "AWS keys successfully written to BASH_ENV"
8383
else
8484
temp_file="/tmp/${AWS_CLI_STR_PROFILE_NAME}.keys"
85+
if [[ "$temp_file" == */* ]]; then
86+
temp_folder="${temp_file%/*}"
87+
mkdir -p "$temp_folder"
88+
fi
8589
touch "$temp_file"
8690
{
8791
echo "export AWS_CLI_STR_ACCESS_KEY_ID=\"${AWS_ACCESS_KEY_ID}\""

0 commit comments

Comments
 (0)