Module: SfCli::Sf::Project::GenerateManifest

Included in:
Core
Defined in:
lib/sf_cli/sf/project/generate_manifest.rb

Instance Method Summary collapse

Instance Method Details

#generate_manifest(name: nil, output_dir: nil, api_version: nil, metadata: [], from_org: nil, source_dir: nil) ⇒ Object

Generate the manifest file of a Salesforce DX project

Examples:

sf.project.generate_manifest metadata: %w[CustomObject Layout] # creates a package.xml, which is initialized with CustomObject and Layout
sf.project.generate_manifest from_org: org_name                # creates a package.xml, which is initialized with all metadata types in the org

See Also:



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/sf_cli/sf/project/generate_manifest.rb', line 16

def generate_manifest(name: nil, output_dir: nil, api_version: nil, metadata: [], from_org: nil, source_dir: nil)
  flags    = {
    :name           => name,
    :"metadata"     => (.empty? ? nil : .join(' ')),
    :"from-org"     => from_org,
    :"source-dir"   => source_dir,
    :"output-dir"   => output_dir,
    :"api-version"  => api_version,
  }
  action = __method__.to_s.tr('_', ' ')
  json = exec(action, flags: flags, redirection: :null_stderr)

  json['result']['path']
end