2015-09-14 14:35:58 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var path = require('path');
|
|
|
|
var child_process = require('child_process');
|
|
|
|
|
|
|
|
module.exports = function(newWindow) {
|
|
|
|
if (newWindow) {
|
2015-09-28 19:10:01 +00:00
|
|
|
var launchPackagerScript =
|
|
|
|
path.resolve(__dirname, '..', 'packager', 'launchPackager.command');
|
|
|
|
if (process.platform === 'darwin') {
|
|
|
|
child_process.spawnSync('open', [launchPackagerScript]);
|
|
|
|
} else if (process.platform === 'linux') {
|
|
|
|
child_process.spawn(
|
|
|
|
'xterm',
|
|
|
|
['-e', 'sh', launchPackagerScript],
|
|
|
|
{detached: true});
|
|
|
|
}
|
2015-09-14 14:35:58 +00:00
|
|
|
} else {
|
2015-10-01 14:26:05 +00:00
|
|
|
if (/^win/.test(process.platform)) {
|
|
|
|
child_process.spawn('node', [
|
2015-10-01 14:33:45 +00:00
|
|
|
path.resolve(__dirname, '..', 'packager', 'packager.js'),
|
|
|
|
'--projectRoots',
|
|
|
|
process.cwd(),
|
2015-10-01 14:26:05 +00:00
|
|
|
], {stdio: 'inherit'});
|
|
|
|
} else {
|
|
|
|
child_process.spawn('sh', [
|
|
|
|
path.resolve(__dirname, '..', 'packager', 'packager.sh'),
|
|
|
|
'--projectRoots',
|
|
|
|
process.cwd(),
|
|
|
|
], {stdio: 'inherit'});
|
|
|
|
}
|
2015-09-14 14:35:58 +00:00
|
|
|
}
|
2015-09-28 19:10:01 +00:00
|
|
|
};
|