Skip to content

Commit

Permalink
fix: use sudo_if_available for normalisation
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhodgkiss committed Sep 5, 2024
1 parent efa4643 commit edca980
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/config-diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,15 @@ 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() {
local folder="$1"
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
}
Expand Down

0 comments on commit edca980

Please sign in to comment.