From 7c6299053e73020371b6354c9787fc7a26b99b43 Mon Sep 17 00:00:00 2001 From: bvn13 Date: Sat, 22 Aug 2026 12:22:38 +0300 Subject: [PATCH] fix: accept a submodule .git file in the workspace scripts dev-host.sh and export-patches.sh tested the submodule with `[ -d cloudcli/.git ]`. In a normal submodule checkout .git is a *file* pointing at ../.git/modules/cloudcli, so the check failed and both scripts reported "not initialised" right after a successful bootstrap.sh. Co-Authored-By: Claude Opus 5 (1M context) --- scripts/dev-host.sh | 5 ++++- scripts/export-patches.sh | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/dev-host.sh b/scripts/dev-host.sh index 7d37777..a6916ff 100755 --- a/scripts/dev-host.sh +++ b/scripts/dev-host.sh @@ -34,7 +34,10 @@ port_owner() { } require_environment() { - [ -d "$HOST_DIR/.git" ] || { echo "cloudcli/ is not initialised — run ./scripts/bootstrap.sh" >&2; exit 1; } + # -e, not -d: in a submodule checkout .git is a *file* pointing at + # ../.git/modules/cloudcli. It is only a directory when the fork was cloned + # into place by hand. + [ -e "$HOST_DIR/.git" ] || { echo "cloudcli/ is not initialised — run ./scripts/bootstrap.sh" >&2; exit 1; } [ -d "$HOST_DIR/node_modules" ] || { echo "cloudcli/node_modules is missing — run ./scripts/bootstrap.sh" >&2; exit 1; } # The server needs these three compiled; npm >= 12 blocks install scripts by diff --git a/scripts/export-patches.sh b/scripts/export-patches.sh index 270bc86..cf60d99 100755 --- a/scripts/export-patches.sh +++ b/scripts/export-patches.sh @@ -20,7 +20,8 @@ BRANCHES=( "feat/plugin-sidebar-surface:0003-feat-plugin-sidebar-surface.patch" ) -[ -d "$SRC/.git" ] || { echo "cloudcli/ submodule is not initialised — run ./scripts/bootstrap.sh" >&2; exit 1; } +# -e, not -d: in a submodule checkout .git is a file, not a directory. +[ -e "$SRC/.git" ] || { echo "cloudcli/ submodule is not initialised — run ./scripts/bootstrap.sh" >&2; exit 1; } [ -d "$OUT" ] || { echo "plugin-taskwork/patches/ is missing — run ./scripts/bootstrap.sh" >&2; exit 1; } git -C "$SRC" rev-parse --verify --quiet "$BASE_TAG^{commit}" >/dev/null \