From edca980b3e9493568239e7afc7544047cccd3225 Mon Sep 17 00:00:00 2001 From: Jack Hodgkiss Date: Thu, 5 Sep 2024 16:13:51 +0100 Subject: [PATCH] fix: use `sudo_if_available` for normalisation --- scripts/config-diff.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/config-diff.sh b/scripts/config-diff.sh index 15b87d7..1d67c4f 100755 --- a/scripts/config-diff.sh +++ b/scripts/config-diff.sh @@ -255,7 +255,7 @@ function main { local file="$1" local text="$2" - sed -i "s#/tmp/$text/\(.*\)#/tmp/\1#g" "$file" + sudo_if_available sed -i "s#/tmp/$text/\(.*\)#/tmp/\1#g" "$file" } function normalise_files_in_folder() { @@ -263,7 +263,7 @@ function main { local text="$2" # Find all files in the folder and its subfolders and loop through them - find "$folder" -type f -print0 | while IFS= read -r -d '' file; do + sudo_if_available find "$folder" -type f -print0 | while IFS= read -r -d '' file; do normalise_file_text "$file" "$text" done }