Skip to content

Commit 96f4db7

Browse files
committed
fix(scripts): use script's directory for git commands in download-libs.sh
Use git -C "$ROOT_DIR" to ensure git commands run in the script's directory rather than the caller's working directory. This fixes downloading the correct release when the script is invoked from a parent repository (e.g., as a git submodule).
1 parent 4431828 commit 96f4db7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/download-libs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ download_release() {
6565
downloaded=false
6666

6767
# Try 1: Download by git hash (if in a git repo)
68-
if command -v git &>/dev/null && git rev-parse --git-dir &>/dev/null; then
69-
GIT_HASH=$(git rev-parse --short HEAD)
68+
if command -v git &>/dev/null && git -C "$ROOT_DIR" rev-parse --git-dir &>/dev/null; then
69+
GIT_HASH=$(git -C "$ROOT_DIR" rev-parse --short HEAD)
7070
echo "Attempting download for commit: ${GIT_HASH}"
7171
if download_release "$GIT_HASH"; then
7272
downloaded=true

0 commit comments

Comments
 (0)