diff --git a/Jenkinsfile b/Jenkinsfile index a3cccf1..b0dd9ab 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -54,10 +54,21 @@ pipeline { #!/bin/bash cd patches - for i in *.patch; do - echo "Applying patch: $i" - patch -Np1 -i "$i" -d ../phoenix-firestorm/ - done + # Enable nullglob so the pattern returns an empty list if no matches are found + shopt -s nullglob + patch_files=(*.patch) + + # Only proceed if there are patch files + if [ ${#patch_files[@]} -ne 0 ]; then + # Loop over all patch files and apply them + for patch_file in "${patch_files[@]}"; do + echo "Applying $patch_file to ../phoenix-firestorm/" + patch -d ../phoenix-firestorm/ -Np1 -i "$patch_file" + done + echo "All patches applied." + else + echo "No patch files found." + fi ''' } }