Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function writePathAsync() {
let subCommand = process.argv[2];
if (subCommand === 'prepare-detached-build') {
// This is being run from Android Studio or Xcode. Don't want to write PATH in this case.
return;
}
await Binaries.writePathToUserSettingsAsync();
}
async function writePathAsync() {
let subCommand = process.argv[2];
if (subCommand === 'prepare-detached-build') {
// This is being run from Android Studio or Xcode. Don't want to write PATH in this case.
return;
}
await Binaries.writePathToUserSettingsAsync();
}
if (process.platform === 'darwin' && this.props.commandLineArgs) {
let dummyIndex = _.indexOf(this.props.commandLineArgs, 'dummy');
if (dummyIndex === -1) {
return;
}
let argv = require('minimist')(this.props.commandLineArgs.slice(dummyIndex + 1));
let pathEnvironment = argv['path-environment'];
if (pathEnvironment) {
process.env.PATH = pathEnvironment;
}
// Now that we have the correct PATH, write it to UserSettings so that
// it'll work in the future if not started from command line
await Binaries.writePathToUserSettingsAsync();
let executedFrom = argv['executed-from'];
if (!executedFrom) {
return;
}
if (
argv._ &&
argv._.length > 0 &&
(await this._tryStartProjectAsync(path.resolve(executedFrom, argv._[0])))
) {
return;
}
// TODO: only start if exp.json exists
await this._tryStartProjectAsync(executedFrom);