From 567e54289aedcc545d4e4732678e433cbbecf1a6 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Thu, 7 Mar 2019 12:04:27 +0100 Subject: [PATCH] Keep the code clear and simple... --- scripts/upgrade | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index e83811c..16e3a74 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -205,9 +205,12 @@ do # Backup 3rd party applications from the current nextcloud # But do not overwrite if there is any upgrade # (apps directory already exists in Nextcloud archive) - for nc_app_dir in $(ls "${final_path}/apps"); do - [ ! -d "${tmpdir}/apps/${nc_app_dir}" ] \ - && cp -a "${final_path}/apps/${nc_app_dir}" "${tmpdir}/apps/${nc_app_dir}" + for nc_app_dir in "$(ls "$final_path/apps")" + do + if [ ! -d "$tmpdir/apps/$nc_app_dir" ] + then + cp -a "$final_path/apps/$nc_app_dir" "$tmpdir/apps/$nc_app_dir" + fi done # Replace the old nextcloud by the new one