Skip to content

Commit 6e39305

Browse files
leogdionclaude
andcommitted
fix(infra): make ensure-remote-deps.sh cross-platform
- Detect OS type using $OSTYPE - Use sed -i '' on macOS (darwin) - Use sed -i on Linux - Fixes CI failures in GitHub Actions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e1c1c5a commit 6e39305

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Scripts/ensure-remote-deps.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,16 @@ fi
2424
# Switch from local to remote
2525
if grep -q "\.package(path:" "$PACKAGE_FILE"; then
2626
echo "🔄 Switching to remote dependency..."
27-
sed -i '' \
28-
-e 's|\.package(path: "'"$LOCAL_PATH"'")|.package(url: "'"$REMOTE_URL"'", '"$REMOTE_BRANCH"')|g' \
29-
"$PACKAGE_FILE"
27+
# Cross-platform sed: use -i with empty string on macOS, without on Linux
28+
if [[ "$OSTYPE" == "darwin"* ]]; then
29+
sed -i '' \
30+
-e 's|\.package(path: "'"$LOCAL_PATH"'")|.package(url: "'"$REMOTE_URL"'", '"$REMOTE_BRANCH"')|g' \
31+
"$PACKAGE_FILE"
32+
else
33+
sed -i \
34+
-e 's|\.package(path: "'"$LOCAL_PATH"'")|.package(url: "'"$REMOTE_URL"'", '"$REMOTE_BRANCH"')|g' \
35+
"$PACKAGE_FILE"
36+
fi
3037
echo "✅ Switched to remote dependency"
3138
else
3239
echo "⚠️ Unknown dependency format in Package.swift"

0 commit comments

Comments
 (0)