From 1faa0cff3d0294135c2a014365c44c604660c54a Mon Sep 17 00:00:00 2001 From: anmol26s Date: Tue, 25 Sep 2018 00:32:30 +0530 Subject: [PATCH] Upgrade to 2018.09 --- scripts/upgrade | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index ff9dd50..0bc7675 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -39,8 +39,9 @@ ynh_install_app_dependencies 'php-mbstring|base-files(<<9.0)' php5-cli 'php5-ima # Create a temporary directory tmpdir="$(mktemp -d)" # Backup the config file in the temp dir -cp -af "$final_path/.htaccess" "$tmpdir/.htaccess" -cp -af "$final_path/view/smarty3" "$tmpdir/view/smarty3" +cp -af "$final_path/.htaccess" "$tmpdir/." +sudo mkdir -p "$tmpdir/view" +cp -af "$final_path/view/smarty3" "$tmpdir/view/." if [ -f $final_path/.htconfig.php ]; then rm "$final_path/.htconfig.php" cp -f "/var/www/$app/config/local-sample.ini.php" "/var/www/$app/config/local.ini.php" @@ -51,7 +52,8 @@ if [ -f $final_path/.htconfig.php ]; then ynh_replace_string "admin_email =" "admin_email = $admin_mail" "$final_path/config/local.ini.php" ynh_replace_string "register_policy = REGISTER_OPEN" "register_policy = REGISTER_CLOSED" "$final_path/config/local.ini.php" fi -cp -af "$final_path/config/local.ini.php" "$tmpdir/config/local.ini.php" +sudo mkdir -p "$tmpdir/config" +cp -af "$final_path/config/local.ini.php" "$tmpdir/config/." rm -Rf "$final_path" # If final_path doesn't exist, create it @@ -69,9 +71,9 @@ path_url=$(ynh_normalize_url_path $path_url) # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source "$final_path" -sudo cp -af "$tmpdir/.htaccess" "${final_path}" -sudo cp -af "$tmpdir/view/smarty3" "${final_path}/view/smarty3" -sudo cp -af "$tmpdir/config/local.ini.php" "${final_path}/config/local.ini.php" +sudo cp -af "$tmpdir/.htaccess" "${final_path}/." +sudo cp -af "$tmpdir/view/smarty3" "${final_path}/view/." +sudo cp -af "$tmpdir/config/local.ini.php" "${final_path}/config/." sudo rm -Rf "$tmpdir" @@ -81,7 +83,6 @@ sudo mkdir $final_path/addon ynh_setup_source "$final_path/addon" "addons" # 3 - some extra folders -sudo mkdir -p "${final_path}/view/smarty3" sudo chmod -R 775 $final_path/view/smarty3 #=================================================