UNPKG

sfdx-hardis

Version:

Swiss-army-knife Toolbox for Salesforce. Allows you to define a complete CD/CD Pipeline. Orchestrate base commands and assist users with interactive wizards

48 lines 2 kB
import { SfCommand, Flags } from '@salesforce/sf-plugins-core'; import { removePackageXmlFilesContent } from "../../../common/utils/xmlUtils.js"; export class PackageXmlRemove extends SfCommand { static description = `Removes the content of a package.xml file matching another package.xml file`; static examples = ["$ sf hardis packagexml:remove -p package.xml -r destructiveChanges.xml -o my-reduced-package.xml"]; static requiresProject = false; static flags = { packagexml: Flags.string({ char: 'p', description: 'package.xml file to reduce' }), removepackagexml: Flags.string({ char: 'r', description: 'package.xml file to use to filter input package.xml' }), removedonly: Flags.boolean({ char: 'z', description: 'Use this flag to generate a package.xml with only removed items', default: false }), outputfile: Flags.string({ char: 'f', description: 'package.xml output file', required: true }), debug: Flags.boolean({ default: false, description: "debug", }), websocket: Flags.string({ description: "websocket", }), }; packageXmlFile; removePackageXmlFile; removedOnly = false; outputFile; async run() { const { flags } = await this.parse(PackageXmlRemove); this.packageXmlFile = flags.packagexml || 'package.xml'; this.removePackageXmlFile = flags.removepackagexml || 'destructiveChanges.xml'; this.removedOnly = flags.removedonly || false; this.outputFile = flags.outputfile; await removePackageXmlFilesContent(this.packageXmlFile, this.removePackageXmlFile, { logFlag: flags.debug, outputXmlFile: this.outputFile, removedOnly: this.removedOnly }); return { outputPackageXmlFile: this.outputFile }; } } //# sourceMappingURL=remove.js.map