From ab39699cefb024b101f4e24ed53e0768749693db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bonhomme?= Date: Thu, 6 May 2021 15:01:53 +0200 Subject: [PATCH] chg: [config] updated regex to make it more generic --- scripts/update_config_variables.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/scripts/update_config_variables.sh b/scripts/update_config_variables.sh index c7e42dc..4cb9dd9 100644 --- a/scripts/update_config_variables.sh +++ b/scripts/update_config_variables.sh @@ -1,9 +1,7 @@ -version=$(cat ./VERSION.json) -version_affected='{"major":2, "minor":10, "hotfix":3}' -if [[ $version == "$version_affected" ]]; then - conf_file='./config/autoload/local.php' - if [ -f "$conf_file" ]; then - sed -i 's/https:\/\/objects.monarc.lu\/api\/v1\//https:\/\/objects.monarc.lu\/api\//g' "$conf_file" - echo "Done for $conf_file" - fi +#! /usr/bin/env bash + +conf_file='./config/autoload/local.php' +if [ -f "$conf_file" ]; then + sed -E -i "s/(.*) => (.*)\/v1/\1 => \2/g" "$conf_file" + echo "Done for $conf_file" fi