fix(ios): use wrapper script for pod install in cap:sync:ios
The cap:sync:ios npm script was failing with "pod: command not found" because npm scripts don't inherit the same PATH environment as shell scripts, preventing detection of pod installed via rbenv shims. Added pod-install.sh wrapper script that: - Detects pod via command -v or rbenv shims ($HOME/.rbenv/shims/pod) - Executes pod install with the found command - Matches the pod detection logic used in build-native.sh Updated cap:sync:ios script to use the wrapper instead of calling pod install directly, ensuring consistent pod detection across all build contexts.
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
"lint": "eslint . --fix",
|
"lint": "eslint . --fix",
|
||||||
"cap:sync": "npx cap sync && node scripts/fix-capacitor-plugins.js",
|
"cap:sync": "npx cap sync && node scripts/fix-capacitor-plugins.js",
|
||||||
"cap:sync:android": "npx cap sync android && node scripts/fix-capacitor-plugins.js",
|
"cap:sync:android": "npx cap sync android && node scripts/fix-capacitor-plugins.js",
|
||||||
"cap:sync:ios": "npx cap copy ios && node scripts/fix-capacitor-plugins.js && cd ios/App && pod install && cd ../..",
|
"cap:sync:ios": "npx cap copy ios && node scripts/fix-capacitor-plugins.js && cd ios/App && ../../scripts/pod-install.sh && cd ../..",
|
||||||
"postinstall": "node scripts/fix-capacitor-plugins.js"
|
"postinstall": "node scripts/fix-capacitor-plugins.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
25
test-apps/daily-notification-test/scripts/pod-install.sh
Executable file
25
test-apps/daily-notification-test/scripts/pod-install.sh
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Wrapper script to find and run pod install
|
||||||
|
# Handles rbenv shims and standard CocoaPods installations
|
||||||
|
#
|
||||||
|
# @author Matthew Raymer
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Get pod command (handles rbenv)
|
||||||
|
get_pod_command() {
|
||||||
|
if command -v pod &> /dev/null; then
|
||||||
|
echo "pod"
|
||||||
|
elif [ -f "$HOME/.rbenv/shims/pod" ]; then
|
||||||
|
echo "$HOME/.rbenv/shims/pod"
|
||||||
|
else
|
||||||
|
echo "pod" # Let it fail with standard error message
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Find pod command
|
||||||
|
POD_CMD=$(get_pod_command)
|
||||||
|
|
||||||
|
# Run pod install
|
||||||
|
exec "$POD_CMD" install "$@"
|
||||||
Reference in New Issue
Block a user