Fix warning when there's no patches folder

This commit is contained in:
Alexandre Aubin 2021-04-05 18:39:08 +02:00
parent 42f8c9dcc1
commit 86f22d1b46

View file

@ -222,15 +222,18 @@ ynh_setup_source () {
fi fi
# Apply patches # Apply patches
local patches_folder=$(realpath $YNH_APP_BASEDIR/sources/patches/) if [ -d "$YNH_APP_BASEDIR/sources/patches/" ]
if (( $(find $patches_folder -type f -name "${source_id}-*.patch" 2> /dev/null | wc --lines) > "0" ))
then then
(cd "$dest_dir" local patches_folder=$(realpath $YNH_APP_BASEDIR/sources/patches/)
for p in $patches_folder/${source_id}-*.patch if (( $(find $patches_folder -type f -name "${source_id}-*.patch" 2> /dev/null | wc --lines) > "0" ))
do then
echo $p (cd "$dest_dir"
patch --strip=1 < $p for p in $patches_folder/${source_id}-*.patch
done) || ynh_die --message="Unable to apply patches" do
echo $p
patch --strip=1 < $p
done) || ynh_die --message="Unable to apply patches"
fi
fi fi
# Add supplementary files # Add supplementary files