feat: add OS compatibility checks before running platform-specific logic

- lib/common.sh: add require_local_os, require_remote_os, require_remote_pkg_manager
- setup/macbook.sh: require macOS (Darwin)
- setup/unraid.sh: require remote is Linux
- setup/fedora.sh: require remote is Linux + has dnf (RPM-based)
- manage_runner.sh: native runner add/remove requires macOS
- run_all.sh: control plane must be macOS
- preflight.sh: 3 new checks (1: local=macOS, 2: Unraid=Linux, 3: Fedora=Linux+dnf)
- phase5_migrate_pipelines.sh: fix sed -i to be portable (no macOS-only syntax)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
S
2026-02-26 19:00:13 -06:00
parent 40fe847755
commit 720197bb10
8 changed files with 164 additions and 38 deletions

View File

@@ -114,13 +114,16 @@ for repo in "${REPOS[@]}"; do
mv "$tmpwf" "$dest"
# Replace GitHub-specific context variables with Gitea equivalents
# Using sed -i '' for macOS compatibility (GNU sed uses -i without arg)
sed -i '' \
# Using sed with a temp file for portability (macOS sed -i requires '',
# GNU sed -i requires no arg — avoiding both by writing to a temp file)
tmpwf=$(mktemp)
sed \
-e 's/github\.repository/gitea.repository/g' \
-e 's/github\.event/gitea.event/g' \
-e 's/github\.token/gitea.token/g' \
-e 's/github\.server_url/gitea.server_url/g' \
"$dest"
"$dest" > "$tmpwf"
mv "$tmpwf" "$dest"
log_info " Migrated: ${local_name}"
done