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 listSimulatorsAsync() {
try {
var output = await child_process.promise.exec('xcrun simctl list devices');
} catch (e) {
throw SimulatorNotAvailable(e);
}
var lines = output.split("\n");
var devices = [];
var runtime;
for (var line of lines) {
var m = line.match(/^-- ([^-]+) --$/);
if (m) {
runtime = m[1];
if (runtime.match(/^Unavailable: /)) {
runtime = undefined;
}
}
var ok = yield urlUtil.testUrlAsync(httpUrl);
} catch (e) {
throw CommandError('RUN_EXP_START_FIRST', env, 'You may need to run `exp start` to get a URL\n' + e.message);
} finally {
simpleSpinner.stop();
}
log('OK.');
}
log('Opening article in web simulator...');
console.log();
console.log(crayon.underline(appetizeUrl));
console.log();
if (process.platform === 'darwin') {
var result = yield child_process.promise.exec('open ' + appetizeUrl, { stdio: 'inherit' });
} else {
log.error('Sorry, opening the URL for the web simulator automatically only works on Mac for now.');
}
return appetizeUrl;
}) };
//# sourceMappingURL=../sourcemaps/commands/web.js.map
var ok = await urlUtil.testUrlAsync(httpUrl);
} catch (e) {
throw CommandError('RUN_EXP_START_FIRST', env, "You may need to run `exp start` to get a URL\n" + e.message);
} finally {
simpleSpinner.stop();
}
log("OK.");
}
log("Opening article in web simulator...");
console.log();
console.log(crayon.underline(appetizeUrl));
console.log();
if (process.platform === 'darwin') {
var result = await child_process.promise.exec("open " + appetizeUrl, {stdio: 'inherit'});
} else {
log.error("Sorry, opening the URL for the web simulator automatically only works on Mac for now.");
}
return appetizeUrl;
},
};
var listSimulatorsAsync = _asyncToGenerator(function* () {
try {
var output = yield child_process.promise.exec('xcrun simctl list devices');
} catch (e) {
throw SimulatorNotAvailable(e);
}
var lines = output.split('\n');
var devices = [];
var runtime;
for (var line of lines) {
var m = line.match(/^-- ([^-]+) --$/);
if (m) {
runtime = m[1];
if (runtime.match(/^Unavailable: /)) {
runtime = undefined;
}
}
async function latestExpVersionAsync() {
var packageName = await jsonFile(path.join(__dirname, '..', 'package.json')).getAsync('name');
var version_ = await child_process.promise.exec('npm view ' + packageName + ' version');
return version_.trim();
}
async function openUrlOnSimulatorAsync(url) {
return child_process.promise.exec('xcrun simctl openurl booted ' + JSON.stringify(url));
}
var latestExpVersionAsync = _asyncToGenerator(function* () {
var packageName = yield jsonFile(path.join(__dirname, '..', 'package.json')).getAsync('name');
var version_ = yield child_process.promise.exec('npm view ' + packageName + ' version');
return version_.trim();
});