1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-29 18:52:22 +01:00

validate each files when upgrading nginx config

This commit is contained in:
Sylvain 2021-03-10 15:12:51 +01:00
parent 58f3cf0988
commit 72ede2843c

View File

@ -53,7 +53,17 @@ test_docker_compose()
proceed_upgrade()
{
find "$NGINX_PATH" -name "*.conf" -exec sed -i -e 's:location ^~ /assets/ {:location ^~ /packs/ {:g' {} \; 2>/dev/null
files=()
while IFS= read -r -d $'\0'; do
files+=("$REPLY")
done < <(find "$NGINX_PATH" -name "*.conf" -print0 2>/dev/null)
for file in "${files[@]}"; do
read -rp "Process \"$file\" (y/N)? " confirm </dev/tty
if [[ "$confirm" = "y" ]]; then
sed -i.bak -e 's:location ^~ /assets/ {:location ^~ /packs/ {:g' "$file"
echo "$file was successfully upgraded"
fi
done
}