Class: Psdk::Cli::Plugin

Inherits:
Thor
  • Object
show all
Defined in:
lib/psdk/cli/plugin.rb

Overview

Class responsible of handling the psdk-plugin cli commands

Instance Method Summary collapse

Instance Method Details

#build(plugin_name = nil) ⇒ Object

rubocop:disable Metrics/MethodLength



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/psdk/cli/plugin.rb', line 28

def build(plugin_name = nil) # rubocop:disable Metrics/MethodLength
  require_relative 'configuration'
  require_relative '../helpers/plugin_manager'
  Psdk::Cli::Configuration.get(:local)

  in_project = Psdk::Cli::Configuration.project_path
  in_project = false if options[:no_psdk_project]

  plugin_name = '.' if !in_project && plugin_name.nil?

  unless plugin_name
    puts 'Error: You must provide a plugin_name when building inside a PSDK project.'
    exit(1)
  end

  PluginManager.build(plugin_name, in_project: in_project, out_dir: options[:out_dir])
end

#listObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/psdk/cli/plugin.rb', line 12

def list
  require_relative 'configuration'
  require_relative '../helpers/plugin_manager'
  Psdk::Cli::Configuration.get(:local)

  unless Psdk::Cli::Configuration.project_path
    puts 'Error: You must be inside a PSDK project to use `psdk-plugin list`.'
    exit(1)
  end

  PluginManager.list
end