Skip to content

Commit

Permalink
remove not needed global
Browse files Browse the repository at this point in the history
  • Loading branch information
dorsradek committed Aug 19, 2024
1 parent 1e1c76a commit 8f715c0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 22 deletions.
30 changes: 8 additions & 22 deletions parse-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,38 +30,24 @@ load_dir() {
# $3, is the numbers of characters to strip in front of the key
KEY="${KEY:$3}"

# Removes the infrastructure.global prefix if it exists
# Removes the infrastructure.global. prefix if it exists
if [[ "$KEY" == "infrastructure.global."* ]]; then
KEY=${KEY#"infrastructure.global."}
fi

if [[ "$KEY" =~ infrastructure\.[^.]+\.global\..+ ]]; then
# Remove 'infrastructure.' prefix
TEMP=${KEY#infrastructure.}

# Split off the part after 'global.'
PART_BEFORE_GLOBAL=${TEMP%%.global.*}
PART_AFTER_GLOBAL=${TEMP#*.global.}

# Combine the parts
KEY="${PART_BEFORE_GLOBAL}.${PART_AFTER_GLOBAL}"
# Removes the infrastructure. prefix if it exists
if [[ "$KEY" == "infrastructure."* ]]; then
KEY=${KEY#"infrastructure."}
fi

# Removes the application.global prefix if it exists
# Removes the application.global. prefix if it exists
if [[ "$KEY" == "application.global."* ]]; then
KEY=${KEY#"application.global."}
fi

if [[ "$KEY" =~ application\.[^.]+\.global\..+ ]]; then
# Remove 'application.' prefix
TEMP=${KEY#application.}

# Split off the part after 'global.'
PART_BEFORE_GLOBAL=${TEMP%%.global.*}
PART_AFTER_GLOBAL=${TEMP#*.global.}

# Combine the parts
KEY="${PART_BEFORE_GLOBAL}.${PART_AFTER_GLOBAL}"
# Removes the application. prefix if it exists
if [[ "$KEY" == "application."* ]]; then
KEY=${KEY#"application."}
fi

# Removes the application.$application_name prefix if it exists
Expand Down

0 comments on commit 8f715c0

Please sign in to comment.