Update capacitor version
This commit is contained in:
parent
91155bce0a
commit
f3b3a86b32
610 changed files with 28718 additions and 7101 deletions
24
@capacitor/cli/dist/tasks/run.js
vendored
24
@capacitor/cli/dist/tasks/run.js
vendored
|
@ -2,7 +2,6 @@
|
|||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.run = exports.runCommand = void 0;
|
||||
const tslib_1 = require("tslib");
|
||||
const utils_process_1 = require("@ionic/utils-process");
|
||||
const utils_terminal_1 = require("@ionic/utils-terminal");
|
||||
const run_1 = require("../android/run");
|
||||
const colors_1 = tslib_1.__importDefault(require("../colors"));
|
||||
|
@ -16,8 +15,7 @@ const native_run_1 = require("../util/native-run");
|
|||
const sync_1 = require("./sync");
|
||||
async function runCommand(config, selectedPlatformName, options) {
|
||||
var _a, _b, _c, _d;
|
||||
options.host =
|
||||
(_b = (_a = options.host) !== null && _a !== void 0 ? _a : livereload_1.CapLiveReloadHelper.getIpAddress()) !== null && _b !== void 0 ? _b : 'localhost';
|
||||
options.host = (_b = (_a = options.host) !== null && _a !== void 0 ? _a : livereload_1.CapLiveReloadHelper.getIpAddress()) !== null && _b !== void 0 ? _b : 'localhost';
|
||||
options.port = (_c = options.port) !== null && _c !== void 0 ? _c : '3000';
|
||||
if (selectedPlatformName && !(await (0, common_1.isValidPlatform)(selectedPlatformName))) {
|
||||
const platformDir = (0, common_1.resolvePlatform)(config, selectedPlatformName);
|
||||
|
@ -39,7 +37,7 @@ async function runCommand(config, selectedPlatformName, options) {
|
|||
}
|
||||
if (options.list) {
|
||||
const targets = await (0, native_run_1.getPlatformTargets)(platformName);
|
||||
const outputTargets = targets.map(t => {
|
||||
const outputTargets = targets.map((t) => {
|
||||
var _a;
|
||||
return ({
|
||||
name: (0, common_1.getPlatformTargetName)(t),
|
||||
|
@ -47,12 +45,11 @@ async function runCommand(config, selectedPlatformName, options) {
|
|||
id: (_a = t.id) !== null && _a !== void 0 ? _a : '?',
|
||||
});
|
||||
});
|
||||
// TODO: make hidden commander option (https://github.com/tj/commander.js/issues/1106)
|
||||
if (process.argv.includes('--json')) {
|
||||
if (options.json) {
|
||||
process.stdout.write(`${JSON.stringify(outputTargets)}\n`);
|
||||
}
|
||||
else {
|
||||
const rows = outputTargets.map(t => [t.name, t.api, t.id]);
|
||||
const rows = outputTargets.map((t) => [t.name, t.api, t.id]);
|
||||
log_1.output.write(`${(0, utils_terminal_1.columnar)(rows, {
|
||||
headers: ['Name', 'API', 'Target ID'],
|
||||
vsep: ' ',
|
||||
|
@ -73,7 +70,7 @@ async function runCommand(config, selectedPlatformName, options) {
|
|||
}
|
||||
await run(config, platformName, options);
|
||||
if (options.liveReload) {
|
||||
new Promise(resolve => process.on('SIGINT', resolve))
|
||||
new Promise((resolve) => process.on('SIGINT', resolve))
|
||||
.then(async () => {
|
||||
await livereload_1.CapLiveReloadHelper.revertCapConfigForLiveReload();
|
||||
if (platformName === config.android.name) {
|
||||
|
@ -82,7 +79,7 @@ async function runCommand(config, selectedPlatformName, options) {
|
|||
})
|
||||
.then(() => process.exit());
|
||||
log_1.logger.info(`App running with live reload listing for: http://${options.host}:${options.port}. Press Ctrl+C to quit.`);
|
||||
await (0, utils_process_1.sleepForever)();
|
||||
await sleepForever();
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
|
@ -110,5 +107,12 @@ async function run(config, platformName, options) {
|
|||
}
|
||||
exports.run = run;
|
||||
function createRunnablePlatformFilter(config) {
|
||||
return platform => platform === config.ios.name || platform === config.android.name;
|
||||
return (platform) => platform === config.ios.name || platform === config.android.name;
|
||||
}
|
||||
async function sleepForever() {
|
||||
return new Promise(() => {
|
||||
setInterval(() => {
|
||||
/* do nothing */
|
||||
}, 1000);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue