vaultwarden-web/scripts/generate_patch_file.sh
BlackDex 87f3999a0b
Update to web-vault v2022.11.1
This PR updates the web-vault to v2022.11.1
It also replaces the main logo and top left icon to indicate it is
Vaultwarden.

And the footer text has been change to `Vaultwarden (unofficial Bitwarden® server)`

This hopefully helps causing less confusion.
2022-12-01 00:17:56 +01:00

37 lines
1.1 KiB
Bash
Executable file

#!/usr/bin/env bash
set -o pipefail -o errexit
BASEDIR=$(dirname "$(readlink -f "$0")")
# Error handling
handle_error() {
read -n1 -r -p "FAILED: line $1, exit code $2. Press any key to exit..." _
exit 1
}
trap 'handle_error $LINENO $?' ERR
# Load default script environment variables
# shellcheck source=.script_env
. "${BASEDIR}/.script_env"
pushd "${VAULT_FOLDER}"
VAULT_VERSION=$(get_web_vault_version)
# Check if the vault versions starts with 20 and isn't a 40 char hash
if [[ ${VAULT_VERSION} = 20* ]] && [ ${#VAULT_VERSION} -ne 40 ]; then
VAULT_VERSION="v${VAULT_VERSION}"
fi
PATCH_FILENAME="${VAULT_VERSION}.patch"
if [ "$(git status --porcelain | wc -l)" -ge 1 ]; then
git --no-pager diff --no-color --minimal -- . \
':!package-lock.json' \
':!apps/web/src/images/logo-dark@2x.png' \
':!apps/web/src/images/logo-white@2x.png' \
':!apps/web/src/images/icon-white.png' \
> "../patches/${PATCH_FILENAME}"
echo "Patch has been created here: patches/${PATCH_FILENAME}"
else
echo "No changes found, skip generating a patch file."
fi
popd