How to use the @salesforce/command.flags.directory function in @salesforce/command

To help you get started, we’ve selected a few @salesforce/command examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stomita / sfdx-migration-automatic / src / commands / automig / dump.ts View on Github external
protected static flagsConfig = {
    // flag with a value (-n, --name=VALUE)
    config: flags.filepath({
      char: 'f',
      description: messages.getMessage('configFlagDescription')
    }),
    objects: flags.array({
      char: 'o',
      description: messages.getMessage('objectsFlagDescription'),
      map: (value: string) => {
        const [ object, target = 'query' ] = value.split(':');
        return { object, target };
      }
    }),
    outputdir: flags.directory({
      char: 'd',
      description: messages.getMessage('outputDirFlagDescription')
    }),
    excludebom: flags.boolean({
      description: messages.getMessage('excludeBomFlagDescription')
    })
  };

  // Comment this out if your command does not require an org username
  protected static requiresUsername = true;

  // Comment this out if your command does not support a hub org username
  protected static supportsDevhubUsername = false;

  // Set this to true if your command requires a project workspace; 'requiresProject' is false by default
  protected static requiresProject = false;
github stomita / sfdx-migration-automatic / src / commands / automig / load.ts View on Github external
export default class Load extends SfdxCommand {

  public static description = messages.getMessage('commandDescription');

  public static get usage() {
    return SfdxCommand.usage.replace('<%= command.id %>', 'automig:load');
  }

  public static examples = [
  '$ sfdx automig:load --targetusername username@example.com --inputdir ./data',
  '$ sfdx automig:load --targetusername username@example.com --inputdir ./data --mappingobjects User:Email,RecordType:DeveloperName'
  ];

  protected static flagsConfig = {
    // flag with a value (-n, --name=VALUE)
    inputdir: flags.directory({
      char: 'd',
      description: messages.getMessage('inputDirFlagDescription'),
      required: true
    }),
    mappingobjects: flags.array({
      char: 'm',
      description: messages.getMessage('mappingObjectsFlagDescription'),
      map: (value: string) => {
        const [ object, keyField = 'Name' ] = value.split(':');
        return { object, keyField };
      }
    }),
    deletebeforeload: flags.boolean({
      description: messages.getMessage('deleteBeforeLoadFlagDescription')
    }),
    verbose: flags.builtin()