fix(shell): remove runtime early-exit pipe hazards (#1105)
Co-authored-by: f10-coder <[email protected]>
This commit was merged in pull request #1105.
This commit is contained in:
+8
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user