Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions bin/update-plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ java -jar "${TMP_DIR}/jenkins-plugin-manager.jar" -f plugins.txt --available-upd

mv plugins2.txt plugins.txt

## Generate a patch without comments removal(s)
# the first sed removes the comments removal(s) from the patch
# the second sed fixes the patch by keeping the same amount of context before and after, since plugins are only updated and not removed with this script
git diff -p --stat plugins.txt | sed -r 's/-#/ #/' | sed -r 's/@@ -([0-9]+),([0-9]+) \+([0-9]+),[0-9]+/@@ -\1,\2 +\3,\2/' > patch-plugins-only.txt
# Restore plugins.txt and apply the modified patch
git restore plugins.txt
git apply patch-plugins-only.txt
# Remove the patch
rm patch-plugins-only.txt

git diff plugins.txt

echo "Updating plugins complete"
Expand Down