404

[ Avaa Bypassed ]




Upload:

Command:

botdev@3.21.21.220: ~ $
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RepairCommand = void 0;
const utils_fs_1 = require("@ionic/utils-fs");
const utils_terminal_1 = require("@ionic/utils-terminal");
const path = require("path");
const color_1 = require("../lib/color");
const command_1 = require("../lib/command");
const errors_1 = require("../lib/errors");
const executor_1 = require("../lib/executor");
class RepairCommand extends command_1.Command {
    async getMetadata() {
        return {
            name: 'repair',
            type: 'project',
            summary: 'Remove and recreate dependencies and generated files',
            description: `
This command may be useful when obscure errors or issues are encountered. It removes and recreates dependencies of your project.

For Cordova apps, it removes and recreates the generated native project and the native dependencies of your project.
`,
            options: [
                {
                    name: 'cordova',
                    summary: 'Only perform the repair steps for Cordova platforms and plugins.',
                    type: Boolean,
                },
            ],
        };
    }
    async run(inputs, options, runinfo) {
        if (!this.project) {
            throw new errors_1.FatalException(`Cannot run ${color_1.input('ionic repair')} outside a project directory.`);
        }
        const { pkgManagerArgs } = await Promise.resolve().then(() => require('../lib/utils/npm'));
        const [installer, ...installerArgs] = await pkgManagerArgs(this.env.config.get('npmClient'), { command: 'install' });
        const cordovaOnly = !!options['cordova'];
        const cordova = this.project.getIntegration('cordova');
        if (cordovaOnly && !cordova) {
            throw new errors_1.FatalException(`${color_1.input('--cordova')} was specified, but Cordova has not been added to this project.`);
        }
        if (cordova && !cordova.enabled) {
            this.env.log.warn(`Cordova integration found, but is disabled--not running repair for Cordova.`);
        }
        if (this.env.flags.interactive) {
            const steps = [];
            if (!cordovaOnly) {
                steps.push(`- Remove ${color_1.strong('node_modules/')} and ${color_1.strong('package-lock.json')}\n` +
                    `- Run ${color_1.input([installer, ...installerArgs].join(' '))} to restore dependencies\n`);
            }
            if (cordova && cordova.enabled) {
                steps.push(`- Remove ${color_1.strong('platforms/')} and ${color_1.strong('plugins/')}\n` +
                    `- Run ${color_1.input('cordova prepare')} to restore platforms and plugins\n`);
            }
            if (steps.length === 0) {
                this.env.log.ok(`${color_1.input('ionic repair')} has nothing to do.`);
                throw new errors_1.FatalException('', 0);
            }
            this.env.log.info(`${color_1.input('ionic repair')} will do the following:\n\n` + steps.join(''));
        }
        const confirm = await this.env.prompt({
            type: 'confirm',
            name: 'confirm',
            message: 'Continue?',
            default: false,
        });
        if (!confirm) {
            throw new errors_1.FatalException(`Not running ${color_1.input('ionic repair')}.`);
        }
        this.env.log.nl();
        if (!cordovaOnly) {
            await this.npmRepair(this.project);
        }
        if (cordova && cordova.enabled) {
            await this.cordovaRepair(cordova, runinfo);
        }
    }
    async npmRepair(project) {
        const { pkgManagerArgs } = await Promise.resolve().then(() => require('../lib/utils/npm'));
        const [installer, ...installerArgs] = await pkgManagerArgs(this.env.config.get('npmClient'), { command: 'install' });
        const tasks = this.createTaskChain();
        const packageLockFile = path.resolve(project.directory, 'package-lock.json');
        const nodeModulesDir = path.resolve(project.directory, 'node_modules');
        tasks.next(`Removing ${color_1.strong(utils_terminal_1.prettyPath(packageLockFile))}`);
        const packageLockFileExists = await utils_fs_1.pathExists(packageLockFile);
        if (packageLockFileExists) {
            await utils_fs_1.unlink(packageLockFile);
        }
        tasks.next(`Removing ${color_1.strong(utils_terminal_1.prettyPath(nodeModulesDir))}`);
        await utils_fs_1.remove(nodeModulesDir);
        tasks.end();
        await this.env.shell.run(installer, installerArgs, { cwd: project.directory, stdio: 'inherit' });
    }
    async cordovaRepair(cordova, runinfo) {
        const tasks = this.createTaskChain();
        const platformsDir = path.resolve(cordova.root, 'platforms');
        const pluginsDir = path.resolve(cordova.root, 'plugins');
        tasks.next(`Removing ${color_1.strong(utils_terminal_1.prettyPath(platformsDir))}`);
        await utils_fs_1.remove(platformsDir);
        tasks.next(`Removing ${color_1.strong(utils_terminal_1.prettyPath(pluginsDir))}`);
        await utils_fs_1.remove(pluginsDir);
        tasks.end();
        await executor_1.runCommand(runinfo, ['cordova', 'prepare', '--no-build']);
    }
}
exports.RepairCommand = RepairCommand;

Filemanager

Name Type Size Permission Actions
capacitor Folder 0755
config Folder 0755
cordova Folder 0755
deploy Folder 0755
doctor Folder 0755
enterprise Folder 0755
git Folder 0755
integrations Folder 0755
monitoring Folder 0755
package Folder 0755
ssh Folder 0755
ssl Folder 0755
build.d.ts File 484 B 0644
build.js File 2.58 KB 0644
completion.d.ts File 315 B 0644
completion.js File 2 KB 0644
docs.d.ts File 309 B 0644
docs.js File 1.77 KB 0644
generate.d.ts File 436 B 0644
generate.js File 2.29 KB 0644
help.d.ts File 309 B 0644
help.js File 2.42 KB 0644
index.d.ts File 763 B 0644
index.js File 6.07 KB 0644
info.d.ts File 309 B 0644
info.js File 2.84 KB 0644
init.d.ts File 615 B 0644
init.js File 9.29 KB 0644
ionitron.d.ts File 313 B 0644
ionitron.js File 1.07 KB 0644
link.d.ts File 1.23 KB 0644
link.js File 22.04 KB 0644
login.d.ts File 507 B 0644
login.js File 7.78 KB 0644
logout.d.ts File 311 B 0644
logout.js File 922 B 0644
repair.d.ts File 544 B 0644
repair.js File 5.12 KB 0644
serve.d.ts File 621 B 0644
serve.js File 6.1 KB 0644
share.d.ts File 217 B 0644
share.js File 780 B 0644
signup.d.ts File 311 B 0644
signup.js File 977 B 0644
start.d.ts File 1.36 KB 0644
start.js File 30.26 KB 0644
state.d.ts File 217 B 0644
state.js File 1.93 KB 0644
telemetry.d.ts File 314 B 0644
telemetry.js File 1.17 KB 0644
version.d.ts File 312 B 0644
version.js File 648 B 0644