From 665b7a3ca136b540a901d37b25b59ea5915110d4 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 16 Oct 2019 01:33:56 +0200 Subject: [PATCH] fix empty local-production.json --- scripts/upgrade | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 8b67fb5..5c3d801 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -111,9 +111,15 @@ then # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" - #Copy the admin saved settings from tmp directory to final path - cp -a "$tmpdir/local-production.json" "$final_path/config/local-production.json" - cp -a "$tmpdir/production.yaml" "$final_path/config/production.yaml" + #Copy the admin saved settings from tmp directory to final path + cp -a "$tmpdir/production.yaml" "$final_path/config/production.yaml" + + if [ -s "$tmpdir/local-production.json" ] + then + cp -a "$tmpdir/local-production.json" "$final_path/config/local-production.json" + else + cp ../conf/local-production.json "$final_path/config/local-production.json" + fi # Remove the tmp directory securely ynh_secure_remove --file="$tmpdir"