Skip to content

Commit

Permalink
fix: Pass in the default values
Browse files Browse the repository at this point in the history
  • Loading branch information
pusewicz committed Mar 17, 2024
1 parent a0f6d90 commit a413c69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/vimpk/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class Install
def initialize(package, options)
@package = package || raise(ArgumentError, "Package name is required")
@path = options.path
@pack = options.pack
@type = options.type
@pack = options.pack || options.default_pack
@type = options.type || options.default_type
@dest = File.join(@path, @pack, @type, File.basename(@package))
@source = "https://github.com/#{package}.git"
@git = Git
Expand Down
4 changes: 2 additions & 2 deletions lib/vimpk/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ class Options
DEFAULT_TYPE = "start"
DEFAULT_PACK = "plugins"

DefaultOptions = Struct.new(:path, :pack, :type)
DefaultOptions = Struct.new(:path, :pack, :type, :default_pack, :default_type)

def initialize(argv)
@argv = argv
@options = DefaultOptions.new(DEFAULT_PATH, DEFAULT_PACK, DEFAULT_TYPE)
@options = DefaultOptions.new(DEFAULT_PATH, nil, nil, DEFAULT_PACK, DEFAULT_TYPE)

@parser = OptionParser.new do |parser|
parser.banner = "Usage: #{parser.program_name} [options] [command [options]"
Expand Down

0 comments on commit a413c69

Please sign in to comment.