From 3aee9078e1fbefbc0a71a1d87d3189a0de90878f Mon Sep 17 00:00:00 2001 From: "Max P." Date: Wed, 2 Jul 2025 13:05:19 +0200 Subject: [PATCH] fix: ensure correct sourcing of utility files in scripts - Updated `scripts/generate-changelog.sh` and `scripts/install-git-cliff.sh` to use `SCRIPT_DIR` for sourcing utility files. - Ensured paths are resolved relative to the script location, independent of the working directory. - Improved script reliability and portability. --- scripts/generate-changelog.sh | 5 +++-- scripts/install-git-cliff.sh | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/generate-changelog.sh b/scripts/generate-changelog.sh index 2314c76..4b5c6cf 100755 --- a/scripts/generate-changelog.sh +++ b/scripts/generate-changelog.sh @@ -18,8 +18,9 @@ # • Generates the changelog; removes a leading empty line. set -euo pipefail -source "$(dirname "$0")/../lib/utils.sh" -source "$(dirname "$0")/../lib/logging.sh" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +source "$SCRIPT_DIR/../lib/utils.sh" +source "$SCRIPT_DIR/../lib/logging.sh" # ─────────────────────────────────────────────── CONFIG_FILE="" diff --git a/scripts/install-git-cliff.sh b/scripts/install-git-cliff.sh index 0e340c2..3c892de 100755 --- a/scripts/install-git-cliff.sh +++ b/scripts/install-git-cliff.sh @@ -14,8 +14,9 @@ # • If a specific version was requested, the installed version is compared; identical → exit, different → upgrade. set -euo pipefail -source "$(dirname "$0")/../lib/utils.sh" -source "$(dirname "$0")/../lib/logging.sh" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +source "$SCRIPT_DIR/../lib/utils.sh" +source "$SCRIPT_DIR/../lib/logging.sh" REPO="orhun/git-cliff"