UNPKG

create-automaticgpt-template

Version:

AutomaticGPT - A production-ready Expo template with AI chat, authentication, conversation management, analytics, and sharing features

117 lines (96 loc) • 3.24 kB
#!/usr/bin/env node const fs = require('fs'); const path = require('path'); const { execSync } = require('child_process'); console.log('šŸŽ iOS Deployment Setup Helper\n'); // Check if EAS CLI is installed function checkEASCLI() { try { execSync('eas --version', { stdio: 'pipe' }); console.log('āœ… EAS CLI is installed'); return true; } catch (error) { console.log('āŒ EAS CLI not found'); console.log('šŸ“¦ Installing EAS CLI...'); try { execSync('npm install -g @expo/eas-cli', { stdio: 'inherit' }); console.log('āœ… EAS CLI installed successfully'); return true; } catch (installError) { console.log('āŒ Failed to install EAS CLI'); console.log('Please run: npm install -g @expo/eas-cli'); return false; } } } // Check if user is logged in to EAS function checkEASLogin() { try { const result = execSync('eas whoami', { stdio: 'pipe', encoding: 'utf8' }); console.log(`āœ… Logged in as: ${result.trim()}`); return true; } catch (error) { console.log('āŒ Not logged in to EAS'); console.log('Please run: eas login'); return false; } } // Check app.json configuration function checkAppConfig() { const appJsonPath = path.join(process.cwd(), 'app.json'); if (!fs.existsSync(appJsonPath)) { console.log('āŒ app.json not found'); return false; } const appJson = JSON.parse(fs.readFileSync(appJsonPath, 'utf8')); const ios = appJson.expo?.ios; if (!ios?.bundleIdentifier) { console.log('āŒ Bundle identifier not set in app.json'); console.log('Please update app.json with your bundle identifier'); return false; } if (ios.bundleIdentifier.includes('yourcompany')) { console.log('āš ļø Bundle identifier still contains placeholder'); console.log(`Current: ${ios.bundleIdentifier}`); console.log('Please update with your actual company/domain name'); return false; } console.log(`āœ… Bundle identifier: ${ios.bundleIdentifier}`); return true; } // Check if .env file exists function checkEnvFile() { const envPath = path.join(process.cwd(), '.env'); if (!fs.existsSync(envPath)) { console.log('āš ļø .env file not found'); console.log('Copy .env.example to .env and fill in your values'); return false; } console.log('āœ… .env file exists'); return true; } // Main setup check function main() { console.log('Checking iOS deployment setup...\n'); const checks = [ { name: 'EAS CLI Installation', fn: checkEASCLI }, { name: 'EAS Login', fn: checkEASLogin }, { name: 'App Configuration', fn: checkAppConfig }, { name: 'Environment Variables', fn: checkEnvFile }, ]; let allPassed = true; checks.forEach((check) => { console.log(`\nšŸ” ${check.name}:`); const passed = check.fn(); if (!passed) allPassed = false; }); console.log('\n' + '='.repeat(50)); if (allPassed) { console.log('šŸŽ‰ Setup complete! You can now build for iOS:'); console.log(' eas build --platform ios --profile preview'); } else { console.log('āŒ Setup incomplete. Please address the issues above.'); console.log('šŸ“– See docs/deployment/IOS_DEPLOYMENT.md for detailed instructions'); } } main();