Skip to content

Commit be753fb

Browse files
fix
1 parent cd36fb1 commit be753fb

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

parse-config.sh

+4-9
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,8 @@ load_dir() {
2323
fi
2424

2525
# Removes the application.$application_name prefix if it exists
26-
if [[ "$KEY" == "application."* ]]; then
27-
KEY=${KEY#"application."}
28-
fi
29-
30-
# Removes the application.$application_name prefix if it exists
31-
if [[ "$KEY" == "$APPLICATION_NAME."* ]]; then
32-
KEY=${KEY#$APPLICATION_NAME.}
26+
if [[ "$KEY" == "application.$3"* ]]; then
27+
KEY=${KEY#"application.$3."}
3328
fi
3429

3530
# Removes the .terraform suffix if it exists
@@ -51,10 +46,10 @@ load_dir() {
5146
# 2. $WORKDIR/aws-secret
5247

5348
# For aws-parameter-store, we strip the first character since it's always a '_'
54-
AWS_PARAMETER_STORE_VARS=$(load_dir "$WORKDIR/aws-parameter-store" 1)
49+
AWS_PARAMETER_STORE_VARS=$(load_dir "$WORKDIR/aws-parameter-store" 1 $APPLICATION_NAME)
5550
echo "$AWS_PARAMETER_STORE_VARS"
5651

57-
AWS_SECRET_VARS=$(load_dir "$WORKDIR/aws-secret" 0)
52+
AWS_SECRET_VARS=$(load_dir "$WORKDIR/aws-secret" 0 $APPLICATION_NAME)
5853
echo "$AWS_SECRET_VARS"
5954

6055
ENV_VARS=""

test.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
KEY=sputnik.endpoint
2+
3+
if [[ "$KEY" == "$APPLICATION_NAME."* ]]; then
4+
KEY=${KEY#"$APPLICATION_NAME."}
5+
fi
6+
7+
printf "$KEY"

0 commit comments

Comments
 (0)