forked from trent_larson/crowd-funder-for-time-pwa
Remove redundant build:capacitor:* script aliases
- Removed 24 redundant build:capacitor:* scripts that were just aliases - Kept essential build:capacitor and build:capacitor:sync scripts - Improves script clarity and reduces maintenance overhead - No functional changes to build processes
This commit is contained in:
@@ -21,6 +21,7 @@ CLEAN_ONLY=false
|
||||
SYNC_ONLY=false
|
||||
ASSETS_ONLY=false
|
||||
DEPLOY_APP=false
|
||||
AUTO_RUN=false
|
||||
|
||||
# Function to print iOS-specific usage
|
||||
print_ios_usage() {
|
||||
@@ -39,6 +40,7 @@ print_ios_usage() {
|
||||
echo " --sync Sync Capacitor only"
|
||||
echo " --assets Generate assets only"
|
||||
echo " --deploy Deploy app to connected device"
|
||||
echo " --auto-run Auto-run app after build"
|
||||
echo ""
|
||||
echo "Common Options:"
|
||||
echo " -h, --help Show this help message"
|
||||
@@ -48,6 +50,7 @@ print_ios_usage() {
|
||||
echo " $0 --dev --studio # Development build + open Xcode"
|
||||
echo " $0 --prod --ipa # Production IPA build"
|
||||
echo " $0 --test --app # Testing app build"
|
||||
echo " $0 --test --auto-run # Test build + auto-run"
|
||||
echo " $0 --clean # Clean only"
|
||||
echo " $0 --sync # Sync only"
|
||||
echo " $0 --deploy # Build and deploy to device"
|
||||
@@ -94,6 +97,9 @@ parse_ios_args() {
|
||||
--deploy)
|
||||
DEPLOY_APP=true
|
||||
;;
|
||||
--auto-run)
|
||||
AUTO_RUN=true
|
||||
;;
|
||||
-h|--help)
|
||||
print_ios_usage
|
||||
exit 0
|
||||
@@ -250,6 +256,29 @@ deploy_ios_app() {
|
||||
log_info "You can now run the app with: npx cap run ios"
|
||||
}
|
||||
|
||||
# Function to auto-run iOS app
|
||||
auto_run_ios_app() {
|
||||
log_step "Auto-running iOS app..."
|
||||
|
||||
# Check if we're in debug mode (simulator) or release mode (device)
|
||||
if [ "$BUILD_TYPE" = "debug" ]; then
|
||||
log_info "Launching iOS Simulator and installing app"
|
||||
safe_execute "Launching app" "npx cap run ios" || {
|
||||
log_error "Failed to launch iOS app on simulator"
|
||||
return 1
|
||||
}
|
||||
else
|
||||
log_info "Building and installing on real device"
|
||||
# For release builds, we need to use a different approach
|
||||
# since npx cap run ios is primarily for simulators
|
||||
log_warn "Auto-run for release builds requires manual device setup"
|
||||
log_info "Please use Xcode to run the app on your device"
|
||||
return 1
|
||||
fi
|
||||
|
||||
log_success "iOS app launched successfully!"
|
||||
}
|
||||
|
||||
# Parse command line arguments
|
||||
parse_ios_args "$@"
|
||||
|
||||
@@ -357,7 +386,12 @@ if [ "$BUILD_APP" = true ]; then
|
||||
log_success "App bundle built successfully"
|
||||
fi
|
||||
|
||||
# Step 9: Open Xcode if requested
|
||||
# Step 9: Auto-run app if requested
|
||||
if [ "$AUTO_RUN" = true ]; then
|
||||
safe_execute "Auto-running iOS app" "auto_run_ios_app" || exit 9
|
||||
fi
|
||||
|
||||
# Step 10: Open Xcode if requested
|
||||
if [ "$OPEN_STUDIO" = true ]; then
|
||||
safe_execute "Opening Xcode" "npx cap open ios" || exit 8
|
||||
fi
|
||||
@@ -372,6 +406,9 @@ fi
|
||||
if [ "$BUILD_APP" = true ]; then
|
||||
log_info "App build: completed"
|
||||
fi
|
||||
if [ "$AUTO_RUN" = true ]; then
|
||||
log_info "Auto-run: completed"
|
||||
fi
|
||||
if [ "$OPEN_STUDIO" = true ]; then
|
||||
log_info "Xcode: opened"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user