salesforce-alm
Version:
This package contains tools, and APIs, for an improved salesforce.com developer experience.
78 lines (76 loc) • 3.47 kB
JavaScript
;
/*
* Copyright (c) 2020, salesforce.com, inc.
* All rights reserved.
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.SourcePushCommand = void 0;
// This is the legacy converted command file. Ignoring code-coverage since this is generated.
// THIS SHOULD BE REMOVED WHEN CONVERTED TO EXTEND SfdxCommand
/* istanbul ignore file */
const command_1 = require("@salesforce/command");
const core_1 = require("@salesforce/core");
const kit_1 = require("@salesforce/kit");
const source_tracking_1 = require("@salesforce/source-tracking");
const ToolbeltCommand_1 = require("../../../ToolbeltCommand");
const consts = require("../../../lib/core/constants");
core_1.Messages.importMessagesDirectory(__dirname);
const mdapiMessages = core_1.Messages.loadMessages('salesforce-alm', 'mdapi_deploy');
const messages = core_1.Messages.loadMessages('salesforce-alm', 'source_push');
class SourcePushCommand extends ToolbeltCommand_1.ToolbeltCommand {
constructor() {
super(...arguments);
this.lifecycleEventNames = ['predeploy', 'postdeploy'];
}
async run() {
const context = await this.resolveLegacyContext();
source_tracking_1.throwIfInvalid({
org: this.org,
projectPath: this.project.getPath(),
toValidate: 'toolbelt',
command: source_tracking_1.replaceRenamedCommands('force:source:push'),
});
const { SourceApiCommand } = require('../../../lib/source/sourceApiCommand');
context.deploytype = SourceApiCommand.SOURCE_PUSH;
return await this.execLegacyCommand(new SourceApiCommand(false), context);
}
}
exports.SourcePushCommand = SourcePushCommand;
SourcePushCommand.theDescription = messages.getMessage('commandDescription');
SourcePushCommand.longDescription = messages.getMessage('commandDescriptionLong');
SourcePushCommand.help = messages.getMessage('commandHelp');
SourcePushCommand.showProgress = true;
SourcePushCommand.requiresProject = true;
SourcePushCommand.requiresUsername = true;
SourcePushCommand.flagsConfig = {
forceoverwrite: command_1.flags.boolean({
char: 'f',
description: messages.getMessage('forceoverwriteFlagDescription'),
longDescription: messages.getMessage('forceoverwriteFlagDescriptionLong'),
required: false,
}),
ignorewarnings: command_1.flags.boolean({
char: 'g',
description: messages.getMessage('ignorewarningsFlagDescription'),
longDescription: messages.getMessage('ignorewarningsFlagDescriptionLong'),
required: false,
}),
replacetokens: command_1.flags.boolean({
char: 'r',
description: messages.getMessage('replacetokensFlagDescription'),
longDescription: messages.getMessage('replacetokensFlagDescriptionLong'),
required: false,
hidden: true,
}),
wait: command_1.flags.minutes({
char: 'w',
description: mdapiMessages.getMessage('mdapiCliWait', [consts.DEFAULT_SRC_WAIT_MINUTES]),
longDescription: messages.getMessage('waitFlagDescriptionLong'),
required: false,
default: kit_1.Duration.minutes(consts.DEFAULT_SRC_WAIT_MINUTES),
min: kit_1.Duration.minutes(consts.MIN_SRC_WAIT_MINUTES),
}),
};
//# sourceMappingURL=push.js.map