salesforce-alm
Version:
This package contains tools, and APIs, for an improved salesforce.com developer experience.
80 lines (78 loc) • 3.51 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.SourceStatusCommand = 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 source_tracking_1 = require("@salesforce/source-tracking");
const Messages = require("../../../lib/messages");
const ToolbeltCommand_1 = require("../../../ToolbeltCommand");
const messages = Messages();
class SourceStatusCommand extends ToolbeltCommand_1.ToolbeltCommand {
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:status'),
});
if (context.flags.local && context.flags.remote) {
this.ux.warn("We're deprecating the combined use of --remote and --local in API version 54.0. To see both local and remote changes, run `sfdx force:source:status` with no parameters.");
}
const _ = require('lodash');
const SrcStatusCommand = require('../../../lib/source/srcStatusCommand');
if ((_.isNil(context.flags.local) && _.isNil(context.flags.remote)) || context.flags.all) {
context.local = true;
context.remote = true;
}
else if (context.flags.local) {
context.local = true;
}
else if (context.flags.remote) {
context.remote = true;
}
const command = new SrcStatusCommand(context);
return this.execLegacyCommand(command, context);
}
}
exports.SourceStatusCommand = SourceStatusCommand;
SourceStatusCommand.theDescription = messages.getMessage('statusCommandCliDescription');
SourceStatusCommand.longDescription = messages.getMessage('statusCommandCliLongDescription');
SourceStatusCommand.help = messages.getMessage('statusCommandCliHelp');
SourceStatusCommand.showProgress = true;
SourceStatusCommand.requiresProject = true;
SourceStatusCommand.requiresUsername = true;
SourceStatusCommand.flagsConfig = {
all: command_1.flags.boolean({
char: 'a',
description: messages.getMessage('statusCommandAllOptionDescription'),
longDescription: messages.getMessage('statusCommandAllOptionDescriptionLong'),
required: false,
hidden: true,
deprecated: {
version: '53.0',
message: 'To see both local and remote changes, use "sfdx force:source:status".',
},
}),
local: command_1.flags.boolean({
char: 'l',
description: messages.getMessage('statusCommandLocalOptionDescription'),
longDescription: messages.getMessage('statusCommandLocalOptionDescriptionLong'),
required: false,
}),
remote: command_1.flags.boolean({
char: 'r',
description: messages.getMessage('statusCommandRemoteOptionDescription'),
longDescription: messages.getMessage('statusCommandRemoteOptionDescriptionLong'),
required: false,
}),
};
//# sourceMappingURL=status.js.map