Skip to content

Commit

Permalink
fix: use sudo_if_available on normalise_files_in_folder fn
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhodgkiss authored Sep 5, 2024
1 parent 4a506db commit f53c589
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/config-diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ function main {
local file="$1"
local text="$2"

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

function normalise_files_in_folder() {
Expand All @@ -278,7 +278,7 @@ function main {
redact_config_dir "$target_environment_path"
encrypt_config_dir "$target_environment_path"
generate_config "$target_environment_path" "$target_dir"
normalise_files_in_folder "$target_dir" "target-kayobe-env"
sudo_if_available normalise_files_in_folder "$target_dir" "target-kayobe-env"
}

function generate_source_config {
Expand All @@ -293,7 +293,7 @@ function main {
redact_config_dir "$source_environment_path" "$target_kayobe_config_dir"
encrypt_config_dir "$source_environment_path"
generate_config "$source_environment_path" "$source_dir"
normalise_files_in_folder "$source_dir" "source-kayobe-env"
sudo_if_available normalise_files_in_folder "$source_dir" "source-kayobe-env"
}

generate_target_config $1 >/dev/null 2>&1 &
Expand Down

0 comments on commit f53c589

Please sign in to comment.