vaultwarden-web/scripts/apply_patches.sh
BlackDex 6529f1dab0
Update web-vault to v2022.05.0 and misc changes
- Updated web-vault to v2022.05.0
- Made several changes to the build scripts for ease of building/patching etc...
  You can now run `make checkout` to pull/update the repo to the wanted version
  There is also a `make patch-web-vault` to patch the repo
  A `make generate-patch` to create a patch file from the current changes
  And many more changes
2022-06-02 22:10:28 +02:00

19 lines
633 B
Bash
Executable file

#!/usr/bin/env 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 "Exact 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}"
git apply "../patches/${PATCH_NAME}" --reject
echo "Patching successful!"