Files
spacedrive/apps/mobile/scripts/patch-svg.sh
Jamie Pine b4024c860e Mobile app in React Native
+ validation support for Actions
2025-12-05 15:16:41 -08:00

28 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Patch react-native-svg for Yoga compatibility with React Native 0.79
set -e
echo "Patching react-native-svg for Yoga compatibility..."
# Find all instances of the file in bun cache
find "$(dirname "$0")/../../node_modules" -path "*react-native-svg*" -name "RNSVGLayoutableShadowNode.cpp" 2>/dev/null | while read file; do
if [ -f "$file" ]; then
echo "Patching: $file"
# Replace yoga::StyleLength with yoga::Style::SizeLength for setDimension calls
sed -i '' 's/yoga::StyleLength::percent/yoga::Style::SizeLength::percent/g' "$file"
sed -i '' 's/yoga::StyleLength::points/yoga::Style::SizeLength::points/g' "$file"
fi
done
# Also check root node_modules
find "$(dirname "$0")/../../../node_modules" -path "*react-native-svg*" -name "RNSVGLayoutableShadowNode.cpp" 2>/dev/null | while read file; do
if [ -f "$file" ]; then
echo "Patching: $file"
sed -i '' 's/yoga::StyleLength::percent/yoga::Style::SizeLength::percent/g' "$file"
sed -i '' 's/yoga::StyleLength::points/yoga::Style::SizeLength::points/g' "$file"
fi
done
echo "Patch complete!"