@@ -29,49 +29,38 @@ load_dir() {
29
29
30
30
# $3, is the numbers of characters to strip in front of the key
31
31
KEY=" ${KEY: $3 } "
32
+
33
+ # Removes the application.$application_name prefix if it exists
34
+ if [[ " $KEY " == " application.$APPLICATION_NAME ." * ]]; then
35
+ KEY=${KEY# " application.$APPLICATION_NAME ." }
36
+ fi
37
+
38
+ # TODO: remove when not needed - we use tag source instead
39
+ # Removes the .terraform suffix if it exists
40
+ if [[ " $KEY " == * " .terraform" ]]; then
41
+ KEY=${KEY% " .terraform" }
42
+ fi
32
43
33
- # Removes the infrastructure.global prefix if it exists
44
+ # TODO: remove when not needed - we use tag visibility instead
45
+ # Removes the infrastructure.global. prefix if it exists
34
46
if [[ " $KEY " == " infrastructure.global." * ]]; then
35
47
KEY=${KEY# " infrastructure.global." }
36
48
fi
37
49
38
- if [[ " $KEY " =~ infrastructure\. [^.]+\. global\. .+ ]]; then
39
- # Remove 'infrastructure.' prefix
40
- TEMP=${KEY# infrastructure.}
41
-
42
- # Split off the part after 'global.'
43
- PART_BEFORE_GLOBAL=${TEMP%% .global.* }
44
- PART_AFTER_GLOBAL=${TEMP#* .global.}
45
-
46
- # Combine the parts
47
- KEY=" ${PART_BEFORE_GLOBAL} .${PART_AFTER_GLOBAL} "
50
+ # Removes the infrastructure. prefix if it exists
51
+ if [[ " $KEY " == " infrastructure." * ]]; then
52
+ KEY=${KEY# " infrastructure." }
48
53
fi
49
54
50
- # Removes the application.global prefix if it exists
55
+ # TODO: remove when not needed - we use tag visibility instead
56
+ # Removes the application.global. prefix if it exists
51
57
if [[ " $KEY " == " application.global." * ]]; then
52
58
KEY=${KEY# " application.global." }
53
59
fi
54
60
55
- if [[ " $KEY " =~ application\. [^.]+\. global\. .+ ]]; then
56
- # Remove 'application.' prefix
57
- TEMP=${KEY# application.}
58
-
59
- # Split off the part after 'global.'
60
- PART_BEFORE_GLOBAL=${TEMP%% .global.* }
61
- PART_AFTER_GLOBAL=${TEMP#* .global.}
62
-
63
- # Combine the parts
64
- KEY=" ${PART_BEFORE_GLOBAL} .${PART_AFTER_GLOBAL} "
65
- fi
66
-
67
- # Removes the application.$application_name prefix if it exists
68
- if [[ " $KEY " == " application.$APPLICATION_NAME ." * ]]; then
69
- KEY=${KEY# " application.$APPLICATION_NAME ." }
70
- fi
71
-
72
- # Removes the .terraform suffix if it exists
73
- if [[ " $KEY " == * " .terraform" ]]; then
74
- KEY=${KEY% " .terraform" }
61
+ # Removes the application. prefix if it exists
62
+ if [[ " $KEY " == " application." * ]]; then
63
+ KEY=${KEY# " application." }
75
64
fi
76
65
77
66
log " source=$FILENAME destination=$KEY "
0 commit comments