berkshelf 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/Thorfile CHANGED
@@ -7,7 +7,7 @@ require 'bundler/setup'
7
7
  require 'berkshelf'
8
8
  require 'thor/rake_compat'
9
9
 
10
- class Berks < Thor
10
+ class Default < Thor
11
11
  include Thor::RakeCompat
12
12
  Bundler::GemHelper.install_tasks
13
13
 
@@ -8,24 +8,30 @@ module Berkshelf
8
8
  type: :string,
9
9
  aliases: "-c",
10
10
  desc: "Knife configuration file to use.",
11
- required: true
11
+ default: File.expand_path("~/.chef/knife.rb")
12
12
  method_option :without,
13
13
  type: :array,
14
14
  aliases: "-w",
15
15
  desc: "Exclude cookbooks that are in these groups",
16
16
  default: Array.new
17
17
  method_option :force,
18
- type: :array,
18
+ type: :boolean,
19
19
  desc: "Fail the build if any of the specified tags are matched.",
20
20
  default: false
21
21
  method_option :freeze,
22
- type: :array,
22
+ type: :boolean,
23
23
  desc: "Freeze the uploaded cookbooks so that they cannot be overwritten.",
24
24
  default: false
25
25
  desc "upload", "shit"
26
26
  def upload
27
+ begin
28
+ Chef::Config.from_file(File.expand_path(options[:config]))
29
+ rescue Errno::ENOENT
30
+ say "Unable to find a Knife config at #{options[:config]}. Specify a different path with --config.", :red
31
+ exit(10)
32
+ end
33
+
27
34
  ::Berkshelf.ui = Chef::Knife::UI.new(STDOUT, STDERR, STDIN, {})
28
- Chef::Config.from_file(File.expand_path(options[:config]))
29
35
  cookbook_file = ::Berkshelf::Berksfile.from_file(File.join(Dir.pwd, "Berksfile"))
30
36
  cookbook_file.upload(Chef::Config[:chef_server_url],
31
37
  without: options[:without],
@@ -1,3 +1,3 @@
1
1
  module Berkshelf
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berkshelf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -442,7 +442,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
442
442
  version: '0'
443
443
  segments:
444
444
  - 0
445
- hash: -1596652001977554727
445
+ hash: 4586386475461844469
446
446
  requirements: []
447
447
  rubyforge_project:
448
448
  rubygems_version: 1.8.23