fix(shell): remove runtime early-exit pipe hazards (#1105)
ci/woodpecker/push/publish Pipeline failed
ci/woodpecker/push/ci Pipeline was successful

Co-authored-by: f10-coder <[email protected]>
This commit was merged in pull request #1105.
This commit is contained in:
2026-08-07 09:38:37 +00:00
committed by Mos
parent df4c591ab4
commit 3a1203b2f8
20 changed files with 308 additions and 32 deletions
+8 -4
View File
@@ -308,13 +308,17 @@ ensure_monorepo() {
exit 1
fi
# Gitea archives extract to <repo-name>/ inside the work dir
EXTRACTED_DIR="$(find "$WORK_DIR" -maxdepth 1 -mindepth 1 -type d | head -1)"
if [[ -z "$EXTRACTED_DIR" ]] || [[ ! -d "$EXTRACTED_DIR" ]]; then
fail "Could not locate extracted source in archive."
# Gitea archives extract to exactly one <repo-name>/ inside the work dir.
# Read the complete population so a malformed multi-root archive reaches the
# named diagnostic instead of aborting on an upstream SIGPIPE under pipefail.
local -a extracted_dirs=()
mapfile -d '' -t extracted_dirs < <(find "$WORK_DIR" -maxdepth 1 -mindepth 1 -type d -print0)
if [[ "${#extracted_dirs[@]}" -ne 1 ]] || [[ ! -d "${extracted_dirs[0]:-}" ]]; then
fail "Could not locate exactly one extracted source directory in archive."
ls -la "$WORK_DIR" >&2
exit 1
fi
EXTRACTED_DIR="${extracted_dirs[0]}"
}
# Build @mosaicstack/mosaic + @mosaicstack/gateway from source and install both