mirror of
https://github.com/YunoHost-Apps/question2answer_ynh.git
synced 2024-09-03 20:16:07 +02:00
Put ynh_replace_string back (works with regexps)
This commit is contained in:
parent
cc81034475
commit
fbac88a28d
1 changed files with 2 additions and 2 deletions
|
@ -60,9 +60,9 @@ then
|
||||||
ynh_backup_if_checksum_is_different "$nginx_conf_path"
|
ynh_backup_if_checksum_is_different "$nginx_conf_path"
|
||||||
# Replace locations starting with old_path
|
# Replace locations starting with old_path
|
||||||
# Look for every location possible patterns (see https://nginx.org/en/docs/http/ngx_http_core_module.html#location)
|
# Look for every location possible patterns (see https://nginx.org/en/docs/http/ngx_http_core_module.html#location)
|
||||||
sudo sed --in-place "s@location\( \(=\|~\|~\*\|\^~\)\)\? $old_path@location\1 $new_path@" "$nginx_conf_path"
|
ynh_replace_string "location\( \(=\|~\|~\*\|\^~\)\)\? $old_path" "location\1 $new_path" "$nginx_conf_path"
|
||||||
# Replace path in "return" directives
|
# Replace path in "return" directives
|
||||||
sudo sed --in-place "s@return \([[:digit:]]\{3\}\) $old_path@return \1 $new_path@" "$nginx_conf_path"
|
ynh_replace_string "return \([[:digit:]]\{3\}\) $old_path" "return \1 $new_path" "$nginx_conf_path"
|
||||||
ynh_store_file_checksum "$nginx_conf_path"
|
ynh_store_file_checksum "$nginx_conf_path"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue