2023-07-20 21:25:13 +03:00
|
|
|
#!/usr/bin/env bash
|
2022-08-17 00:37:20 +03:00
|
|
|
|
2024-11-05 18:52:48 +03:00
|
|
|
set -e
|
|
|
|
|
2024-11-04 14:14:15 +03:00
|
|
|
echo "$#"
|
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
|
|
|
|
|
2024-11-04 14:14:15 +03:00
|
|
|
while [[ -n "$( git log -1 | grep "VSCODIUM HELPER" )" ]]; do
|
|
|
|
git reset -q --hard HEAD~
|
|
|
|
done
|
|
|
|
|
|
|
|
git apply --reject "../patches/helper/settings.patch"
|
|
|
|
|
|
|
|
while [ $# -gt 1 ]; do
|
|
|
|
echo "Parameter: $1"
|
|
|
|
if [[ "${1}" == *patch ]]; then
|
|
|
|
FILE="../patches/${1}"
|
|
|
|
else
|
|
|
|
FILE="../patches/${1}.patch"
|
|
|
|
fi
|
|
|
|
|
2022-09-27 21:14:27 +03:00
|
|
|
git apply --reject "${FILE}"
|
2024-11-04 14:14:15 +03:00
|
|
|
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
git add .
|
2024-11-05 18:52:48 +03:00
|
|
|
git commit -q -m "VSCODIUM HELPER" --no-verify
|
2024-11-04 14:14:15 +03:00
|
|
|
|
|
|
|
if [[ "${1}" == *patch ]]; then
|
|
|
|
FILE="../patches/${1}"
|
|
|
|
else
|
|
|
|
FILE="../patches/${1}.patch"
|
2022-09-27 21:14:27 +03:00
|
|
|
fi
|
2022-08-17 00:37:20 +03:00
|
|
|
|
2024-11-04 14:14:15 +03:00
|
|
|
if [[ -f "${FILE}" ]]; then
|
|
|
|
git apply --reject "${FILE}"
|
|
|
|
fi
|
2023-01-31 16:33:29 +03:00
|
|
|
|
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
|
|
|
|
2022-11-01 20:56:12 +03:00
|
|
|
git add .
|
|
|
|
git diff --staged -U1 > "${FILE}"
|
2024-11-04 14:14:15 +03:00
|
|
|
git reset -q --hard HEAD~
|
2022-08-17 00:37:20 +03:00
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
echo "The patch has been generated."
|