Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
launchEmulator = (name: string) => {
// On Linux, you must run the emulator from the directory it's in because
// reasons ...
which('emulator')
.then(emulatorPath => {
if (emulatorPath) {
const child = spawn(emulatorPath, [`@${name}`], {
detached: true,
cwd: dirname(emulatorPath),
});
child.stderr.on('data', data => {
console.error(`Android emulator error: ${data}`);
});
child.on('error', console.error);
} else {
throw new Error('Could not get emulator path');
}
})
.catch(console.error);
this.props.preferDevice(name);
launchEmulator = (name: string) => {
// On Linux, you must run the emulator from the directory it's in because
// reasons ...
which('emulator')
.then(emulatorPath => {
if (emulatorPath) {
const child = spawn(emulatorPath, [`@${name}`], {
detached: true,
cwd: dirname(emulatorPath),
});
child.stderr.on('data', data => {
console.error(`Android emulator error: ${data}`);
});
child.on('error', console.error);
} else {
throw new Error('Could not get emulator path');
}
})
.catch(console.error);
this.props.preferDevice(name);