2023-07-20 21:25:13 +03:00
|
|
|
#!/usr/bin/env bash
|
2022-08-17 00:37:20 +03:00
|
|
|
|
2023-01-11 14:22:54 +03:00
|
|
|
if [[ "${1}" == *patch ]]; then
|
|
|
|
FILE="../patches/${1}"
|
|
|
|
else
|
|
|
|
FILE="../patches/${1}.patch"
|
|
|
|
fi
|
2022-08-17 00:37:20 +03:00
|
|
|
|
|
|
|
cd vscode || { echo "'vscode' dir not found"; exit 1; }
|
|
|
|
|
2022-09-25 15:54:41 +03:00
|
|
|
git add .
|
|
|
|
git reset -q --hard HEAD
|
|
|
|
|
2022-09-30 09:44:14 +03:00
|
|
|
if [[ -f "${FILE}" ]]; then
|
2022-09-27 21:14:27 +03:00
|
|
|
git apply --reject "${FILE}"
|
|
|
|
fi
|
2022-08-17 00:37:20 +03:00
|
|
|
|
2023-01-31 16:33:29 +03:00
|
|
|
git apply --reject "../patches/helper/settings.patch"
|
|
|
|
|
2023-07-20 21:25:13 +03:00
|
|
|
read -rp "Press any key when the conflict have been resolved..." -n1 -s
|
2022-08-17 00:37:20 +03:00
|
|
|
|
2023-01-31 16:33:29 +03:00
|
|
|
git restore .vscode/settings.json
|
|
|
|
|
2022-11-01 20:56:12 +03:00
|
|
|
git add .
|
|
|
|
git diff --staged -U1 > "${FILE}"
|
2022-08-17 00:37:20 +03:00
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
echo "The patch has been generated."
|