2022-06-20 04:34:50 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
cd vscode || { echo "'vscode' dir not found"; exit 1; }
|
|
|
|
|
|
|
|
git add .
|
|
|
|
git reset -q --hard HEAD
|
|
|
|
|
2022-11-17 16:56:46 -05:00
|
|
|
for FILE in ../patches/*.patch; do
|
|
|
|
if [ -f "${FILE}" ]; then
|
|
|
|
echo applying patch: "${FILE}"
|
|
|
|
git apply --ignore-whitespace "${FILE}"
|
2022-06-20 04:34:50 -04:00
|
|
|
if [ $? -ne 0 ]; then
|
2022-11-17 16:56:46 -05:00
|
|
|
echo failed to apply patch "${FILE}"
|
|
|
|
git apply --reject "${FILE}"
|
2022-06-20 04:34:50 -04:00
|
|
|
read -p "Press any key when the conflict have been resolved..." -n1 -s
|
2022-11-17 16:56:46 -05:00
|
|
|
git add .
|
|
|
|
git diff --staged -U1 > "${FILE}"
|
2022-06-20 04:34:50 -04:00
|
|
|
fi
|
|
|
|
git add .
|
|
|
|
git reset -q --hard HEAD
|
|
|
|
fi
|
|
|
|
done
|