From 3e1eb1e438e3481e1fc4ee1366d7d80c0dbbf9bc Mon Sep 17 00:00:00 2001 From: Matthew Arbesfeld Date: Wed, 20 Aug 2014 10:54:00 -0700 Subject: [PATCH] Remove open-ide and fold into run ios-device --- tools/commands-cordova.js | 17 +++++++++++---- tools/commands.js | 45 --------------------------------------- 2 files changed, 13 insertions(+), 49 deletions(-) diff --git a/tools/commands-cordova.js b/tools/commands-cordova.js index d30f23169b..abdc9471d8 100644 --- a/tools/commands-cordova.js +++ b/tools/commands-cordova.js @@ -414,7 +414,7 @@ var ensureCordovaPlugins = function (localPath, options) { files.rm_recursive(path.join(cordovaPath, 'platforms')); cordova.ensureCordovaPlatforms(localPath); }; - process.stdout.write("Resetting Cordova plugins...\n"); + process.stdout.write("Initializing Cordova plugins...\n"); uninstallAllPlugins(); // Now install all of the plugins. @@ -533,9 +533,18 @@ var execCordovaOnPlatform = function (localPath, platformName, options) { isDevice ? '--device' : '--emulator', platform ]; - // XXX error if not a Cordova project - execFileAsyncOrThrow(localCordova, args, { verbose: options.verbose, - cwd: cordovaPath }); + // XXX assert we have a valid Cordova project + if (platform === 'ios' && isDevice) { + // ios-deploy is super buggy, so we just open xcode and let the user + // start the app themselves. XXX print a message about this? + execFileSyncOrThrow('sh', + ['-c', 'open ' + path.join(localPath, 'cordova-build', + 'platforms', 'ios', '*.xcodeproj')]); + } else { + execFileAsyncOrThrow(localCordova, args, { verbose: options.verbose, + cwd: cordovaPath }); + } + var Log = getLoadedPackages().logging.Log; var androidMapper = function (line) { diff --git a/tools/commands.js b/tools/commands.js index dddf292a9c..e46d9bb390 100644 --- a/tools/commands.js +++ b/tools/commands.js @@ -939,51 +939,6 @@ main.registerCommand({ } }); - -/////////////////////////////////////////////////////////////////////////////// -// open-ide -/////////////////////////////////////////////////////////////////////////////// - -main.registerCommand({ - name: 'open-ide', - requiresApp: true, - minArgs: 1, - maxArgs: Infinity, - options: { - settings: { type: String }, - port: { type: String, short: "p", default: 'localhost:3000' }, - production: { type: Boolean } - } -}, function (options) { - // XXX replace try-catch with buildmessage.capture - try { - var localPath = path.join(options.appDir, '.meteor', 'local'); - var platforms = options.args; - - // check that every passed argument is in fact a platform we can build for - _.each(platforms, cordova.checkIsValidPlatform); - - var parsedHostPort = parseHostPort(options.port); - - // open projects in ides - cordova.preparePlatforms(localPath, platforms, - _.extend({ debug: ! options.production, - appName: path.basename(options.appDir) }, - options, parsedHostPort)); - - _.each(platforms, function (platform) { - if (platform !== 'ios') - throw new Error(platform + ": unsupported platform for 'open-ide' command. Only 'ios' is supportted at the moment."); - - execFileSync('sh', ['-c', 'open ' + path.join(localPath, 'cordova-build', 'platforms', 'ios', '*.xcodeproj')]); - }); - } catch (err) { - process.stderr.write(err.message + '\n'); - return 1; - } -}); - - /////////////////////////////////////////////////////////////////////////////// // authorized ///////////////////////////////////////////////////////////////////////////////