mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 12:15:37 +08:00
[cli] spawn xterm on linux to run the packager
Also use ANDROID_HOME env var when running adb.
This commit is contained in:
@@ -5,9 +5,16 @@ var child_process = require('child_process');
|
||||
|
||||
module.exports = function(newWindow) {
|
||||
if (newWindow) {
|
||||
child_process.spawnSync('open', [
|
||||
path.resolve(__dirname, '..', 'packager', 'launchPackager.command')
|
||||
]);
|
||||
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});
|
||||
}
|
||||
} else {
|
||||
child_process.spawn('sh', [
|
||||
path.resolve(__dirname, '..', 'packager', 'packager.sh'),
|
||||
@@ -15,4 +22,4 @@ module.exports = function(newWindow) {
|
||||
process.cwd(),
|
||||
], {stdio: 'inherit'});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user