Skip to content

Commit a699268

Browse files
authored
fix: use sudo_if_available for normalisation
1 parent f53c589 commit a699268

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/config-diff.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,15 +255,15 @@ function main {
255255
local file="$1"
256256
local text="$2"
257257

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

261261
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
266-
find "$folder" -type f -print0 | while IFS= read -r -d '' file; do
266+
sudo_if_available find "$folder" -type f -print0 | while IFS= read -r -d '' file; do
267267
normalise_file_text "$file" "$text"
268268
done
269269
}
@@ -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-
sudo_if_available normalise_files_in_folder "$target_dir" "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-
sudo_if_available normalise_files_in_folder "$source_dir" "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)