From 86f22d1b46ee701f258b7bd6366593105c1895d9 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 5 Apr 2021 18:39:08 +0200 Subject: [PATCH] Fix warning when there's no patches folder --- data/helpers.d/utils | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/data/helpers.d/utils b/data/helpers.d/utils index 8db83ef78..f5dd76e92 100644 --- a/data/helpers.d/utils +++ b/data/helpers.d/utils @@ -222,15 +222,18 @@ ynh_setup_source () { fi # Apply patches - local patches_folder=$(realpath $YNH_APP_BASEDIR/sources/patches/) - if (( $(find $patches_folder -type f -name "${source_id}-*.patch" 2> /dev/null | wc --lines) > "0" )) + if [ -d "$YNH_APP_BASEDIR/sources/patches/" ] then - (cd "$dest_dir" - for p in $patches_folder/${source_id}-*.patch - do - echo $p - patch --strip=1 < $p - done) || ynh_die --message="Unable to apply patches" + local patches_folder=$(realpath $YNH_APP_BASEDIR/sources/patches/) + if (( $(find $patches_folder -type f -name "${source_id}-*.patch" 2> /dev/null | wc --lines) > "0" )) + then + (cd "$dest_dir" + for p in $patches_folder/${source_id}-*.patch + do + echo $p + patch --strip=1 < $p + done) || ynh_die --message="Unable to apply patches" + fi fi # Add supplementary files