2022-06-02 21:26:42 +03:00
|
|
|
#!/usr/bin/env bash
|
2020-03-01 02:34:55 +03:00
|
|
|
set -o pipefail -o errexit
|
|
|
|
|
|
|
|
# If a patch was not provided, try to choose one
|
2022-06-02 21:26:42 +03:00
|
|
|
if [[ -z ${PATCH_NAME} ]]; then
|
2020-03-01 02:34:55 +03:00
|
|
|
# If a patch with the same name as the ref exists, use it
|
2022-06-02 21:26:42 +03:00
|
|
|
if [ -f "../patches/${VAULT_VERSION}.patch" ]; then
|
|
|
|
echo "Exact patch file found, using that"
|
|
|
|
PATCH_NAME="${VAULT_VERSION}.patch"
|
2020-03-01 02:34:55 +03:00
|
|
|
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
|
|
|
|
|
2022-11-30 19:52:03 +03:00
|
|
|
echo "Patching images"
|
|
|
|
cp -vf ../resources/logo-dark@2x.png ./apps/web/src/images/logo-dark@2x.png
|
|
|
|
cp -vf ../resources/logo-white@2x.png ./apps/web/src/images/logo-white@2x.png
|
|
|
|
cp -vf ../resources/icon-white.png ./apps/web/src/images/icon-white.png
|
|
|
|
|
2022-06-02 21:26:42 +03:00
|
|
|
echo "Using patch: ${PATCH_NAME}"
|
|
|
|
git apply "../patches/${PATCH_NAME}" --reject
|
2022-11-30 19:52:03 +03:00
|
|
|
|
2020-03-01 02:34:55 +03:00
|
|
|
echo "Patching successful!"
|