Skip to content

Commit 7eefdb9

Browse files
authored
Merge pull request #63 from stackhpc/fix-config-normalisation
fix: use correct path when normalising files
2 parents fae7ea2 + efa4643 commit 7eefdb9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/config-diff.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,20 +251,20 @@ function main {
251251
clean_copy "$KAYOBE_CONFIG_SOURCE_PATH" "$source_kayobe_config_dir"
252252
clean_copy "$KAYOBE_CONFIG_SOURCE_PATH" "$target_kayobe_config_dir"
253253

254-
function normalize_file_text() {
254+
function normalise_file_text() {
255255
local file="$1"
256256
local text="$2"
257257

258258
sed -i "s#/tmp/$text/\(.*\)#/tmp/\1#g" "$file"
259259
}
260260

261-
function normalize_files_in_folder() {
261+
function normalise_files_in_folder() {
262262
local folder="$1"
263263
local text="$2"
264264

265265
# Find all files in the folder and its subfolders and loop through them
266266
find "$folder" -type f -print0 | while IFS= read -r -d '' file; do
267-
normalize_file_text "$file" "$text"
267+
normalise_file_text "$file" "$text"
268268
done
269269
}
270270

@@ -278,7 +278,7 @@ function main {
278278
redact_config_dir "$target_environment_path"
279279
encrypt_config_dir "$target_environment_path"
280280
generate_config "$target_environment_path" "$target_dir"
281-
normalize_files_in_folder "$target_environment_path" "target-kayobe-env"
281+
normalise_files_in_folder "$target_dir" "target-kayobe-env"
282282
}
283283

284284
function generate_source_config {
@@ -293,7 +293,7 @@ function main {
293293
redact_config_dir "$source_environment_path" "$target_kayobe_config_dir"
294294
encrypt_config_dir "$source_environment_path"
295295
generate_config "$source_environment_path" "$source_dir"
296-
normalize_files_in_folder "$source_environment_path" "source-kayobe-env"
296+
normalise_files_in_folder "$source_dir" "source-kayobe-env"
297297
}
298298

299299
generate_target_config $1 >/dev/null 2>&1 &

0 commit comments

Comments
 (0)