vaultwarden-web/scripts/.script_env

20 lines
688 B
Text
Raw Normal View History

#!/usr/bin/env bash
# shellcheck disable=SC2034
set -o pipefail -o errexit
VAULT_FOLDER=${VAULT_FOLDER:=web-vault}
CHECKOUT_TAGS=${CHECKOUT_TAGS:=true}
OUTPUT_FOLDER=builds
function get_web_vault_version {
# First check if we are able to get a tag or branch
VAULT_VERSION=$(git describe --abbrev=0 --tags --exact-match 2>/dev/null || git branch --show-current)
# Else we will use the current commit hash
if [[ -z "${VAULT_VERSION}" ]]; then
VAULT_VERSION=$(git rev-parse HEAD)
fi
# Remove everything up to the first occurrence of "-"
# The extracted tag could start with either `web-`, `desktop-`, `cli-` or `browser-`
echo "${VAULT_VERSION#*-}"
}