2020-03-01 02:34:55 +03:00
|
|
|
#!/bin/bash
|
|
|
|
set -o pipefail -o errexit
|
|
|
|
|
|
|
|
# If a patch was not provided, try to choose one
|
|
|
|
if [[ -z $PATCH_NAME ]]; then
|
|
|
|
# If a patch with the same name as the ref exists, use it
|
|
|
|
if [ -f "../patches/$VAULT_VERSION.patch" ]; then
|
|
|
|
echo "Patch file found, using that"
|
|
|
|
PATCH_NAME="$VAULT_VERSION.patch"
|
|
|
|
else
|
|
|
|
echo "Patch file not found, using latest"
|
|
|
|
# If not, use the latest one
|
|
|
|
PATCH_NAME="$(find ../patches -printf "%f\\n" | sort -V | tail -n1)"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Using patch: $PATCH_NAME"
|
2021-10-27 23:31:31 +03:00
|
|
|
git apply "../patches/$PATCH_NAME" --reject
|
2020-03-01 02:34:55 +03:00
|
|
|
echo "Patching successful!"
|