patch.sh 869 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/usr/bin/env bash
  2. echo "$#"
  3. cd vscode || { echo "'vscode' dir not found"; exit 1; }
  4. git add .
  5. git reset -q --hard HEAD
  6. while [[ -n "$( git log -1 | grep "VSCODIUM HELPER" )" ]]; do
  7. git reset -q --hard HEAD~
  8. done
  9. git apply --reject "../patches/helper/settings.patch"
  10. while [ $# -gt 1 ]; do
  11. echo "Parameter: $1"
  12. if [[ "${1}" == *patch ]]; then
  13. FILE="../patches/${1}"
  14. else
  15. FILE="../patches/${1}.patch"
  16. fi
  17. git apply --reject "${FILE}"
  18. shift
  19. done
  20. git add .
  21. git commit -q -m "VSCODIUM HELPER"
  22. if [[ "${1}" == *patch ]]; then
  23. FILE="../patches/${1}"
  24. else
  25. FILE="../patches/${1}.patch"
  26. fi
  27. if [[ -f "${FILE}" ]]; then
  28. git apply --reject "${FILE}"
  29. fi
  30. read -rp "Press any key when the conflict have been resolved..." -n1 -s
  31. git add .
  32. git diff --staged -U1 > "${FILE}"
  33. git reset -q --hard HEAD~
  34. cd ..
  35. echo "The patch has been generated."