update_patches.sh 520 B

123456789101112131415161718192021
  1. #!/bin/bash
  2. cd vscode || { echo "'vscode' dir not found"; exit 1; }
  3. git add .
  4. git reset -q --hard HEAD
  5. for file in ../patches/*.patch; do
  6. if [ -f "${file}" ]; then
  7. echo applying patch: "${file}"
  8. git apply --ignore-whitespace "${file}"
  9. if [ $? -ne 0 ]; then
  10. echo failed to apply patch "${file}"
  11. git apply --reject "${file}"
  12. read -p "Press any key when the conflict have been resolved..." -n1 -s
  13. git diff -U1 > "${file}"
  14. fi
  15. git add .
  16. git reset -q --hard HEAD
  17. fi
  18. done