Remove open-ide and fold into run ios-device

This commit is contained in:
Matthew Arbesfeld
2014-08-20 10:54:00 -07:00
parent b1abfb4072
commit 3e1eb1e438
2 changed files with 13 additions and 49 deletions

View File

@@ -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) {

View File

@@ -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
///////////////////////////////////////////////////////////////////////////////