Files
omarchy-sc/tests/mode-independence.sh
T
jbergner 5aadfd3427
Citizen Launcher CI / arch-package (push) Failing after 25s
Citizen Launcher CI / rpm-package (push) Failing after 40s
Citizen Launcher CI / verify (push) Successful in 2m44s
v1.1.2
2026-09-01 20:04:15 +02:00

32 lines
1.3 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
python3 - "$ROOT" <<'PY'
from pathlib import Path
import re, sys
root = Path(sys.argv[1])
check = [
root/'build.sh', root/'install-omarchy.sh', root/'INSTALLIEREN.sh',
root/'tests/full-verify.sh', root/'tests/verify.sh', root/'tests/package-verify.sh',
root/'tests/gitea-release-helper.sh', root/'packaging/build-all.sh',
root/'.gitea/workflows/ci.yml', root/'.gitea/workflows/release.yml',
]
for p in check:
text = p.read_text()
bad = []
for lineno, line in enumerate(text.splitlines(), 1):
stripped = line.strip()
if stripped.startswith('#') or stripped.endswith('\\') or stripped.endswith('; do'):
continue
# Direct ./script.sh command (workflow or shell command) without an interpreter.
if re.search(r'(^|[;&|]\s*|run:\s*)\./[^\s"\x27]+\.sh(?:\s|$)', stripped):
bad.append((lineno, stripped))
# Direct "$ROOT/path/script.sh" command at start of a shell line.
if re.search(r'^"?\$ROOT/[^"\s]+\.sh"?(?:\s|$)', stripped):
bad.append((lineno, stripped))
if bad:
raise SystemExit(f'direct shell execution remains in {p}: {bad}')
print('Mode-independent shell invocation: OK')
PY