feat(scripts): check that git is installed in release scripts

This commit is contained in:
peaklabs-dev committed 2026-02-13 16:22:38 +01:00
1 parent 9c7dd0d76e
commit 3986232124
2 files changed
+2

No files matched your search

+1
View File
@@ -8,6 +8,7 @@ info() { echo -e " ${BLUE}info:${OFF} $1"; }
success() { echo -e " ${GREEN}done:${OFF} $1"; } success() { echo -e " ${GREEN}done:${OFF} $1"; }
check_prerequisites() { check_prerequisites() {
command -v git > /dev/null 2>&1 || die "git is not installed. Install it from https://git-scm.com"
git rev-parse --is-inside-work-tree > /dev/null 2>&1 || die "Not a git repository" git rev-parse --is-inside-work-tree > /dev/null 2>&1 || die "Not a git repository"
if ! git diff --quiet || ! git diff --cached --quiet; then if ! git diff --quiet || ! git diff --cached --quiet; then
+1
View File
@@ -8,6 +8,7 @@ info() { echo -e " ${BLUE}info:${OFF} $1"; }
die() { echo -e " ${RED}error:${OFF} $1" >&2; exit 1; } die() { echo -e " ${RED}error:${OFF} $1" >&2; exit 1; }
check_prerequisites() { check_prerequisites() {
command -v git > /dev/null 2>&1 || die "git is not installed. Install it from https://git-scm.com"
git rev-parse --is-inside-work-tree > /dev/null 2>&1 || die "Not a git repository" git rev-parse --is-inside-work-tree > /dev/null 2>&1 || die "Not a git repository"
REPO_ROOT="$(git rev-parse --show-toplevel)" REPO_ROOT="$(git rev-parse --show-toplevel)"