From 4b9bd354335e504aa79bf1b5bc5c8a502465adfb Mon Sep 17 00:00:00 2001 From: Jarne Demeulemeester Date: Mon, 8 May 2023 00:05:46 +0200 Subject: [PATCH] build: fix `patch.sh` when there are no patches --- buildscripts/patch.sh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/buildscripts/patch.sh b/buildscripts/patch.sh index d3b17ee..5126001 100755 --- a/buildscripts/patch.sh +++ b/buildscripts/patch.sh @@ -4,16 +4,18 @@ PATCHES=(patches/*) ROOT=$(pwd) for dep_path in "${PATCHES[@]}"; do - patches=($dep_path/*) - dep=$(echo $dep_path |cut -d/ -f 2) - cd deps/$dep - echo Patching $dep - git reset --hard - for patch in "${patches[@]}"; do - echo Applying $patch - git apply "$ROOT/$patch" - done - cd $ROOT + if [ -d "$dep_path" ]; then + patches=($dep_path/*) + dep=$(echo $dep_path |cut -d/ -f 2) + cd deps/$dep + echo Patching $dep + git reset --hard + for patch in "${patches[@]}"; do + echo Applying $patch + git apply "$ROOT/$patch" + done + cd $ROOT + fi done exit 0