Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Berkshelf requires missing from spork actions checking if Berkshelf is defined #130

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/chef/knife/spork-bump.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
require 'chef/knife'
begin
require 'berkshelf'
rescue LoadError; end


module KnifeSpork
class SporkBump < Chef::Knife
Expand All @@ -18,7 +22,7 @@ class SporkBump < Chef::Knife
if defined?(::Berkshelf)
option :berksfile,
:short => '-b',
:long => 'berksfile',
:long => '--berksfile BERKSFILE',
:description => 'Path to a Berksfile to operate off of',
:default => File.join(Dir.pwd, ::Berkshelf::DEFAULT_FILENAME)

Expand Down
5 changes: 4 additions & 1 deletion lib/chef/knife/spork-check.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
require 'chef/knife'
begin
require 'berkshelf'
rescue LoadError; end

module KnifeSpork
class SporkCheck < Chef::Knife
Expand Down Expand Up @@ -27,7 +30,7 @@ class SporkCheck < Chef::Knife
if defined?(::Berkshelf)
option :berksfile,
:short => '-b',
:long => 'berksfile',
:long => '--berksfile BERKSFILE',
:description => 'Path to a Berksfile to operate off of',
:default => File.join(Dir.pwd, ::Berkshelf::DEFAULT_FILENAME)

Expand Down
6 changes: 3 additions & 3 deletions lib/chef/knife/spork-omni.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
require 'chef/knife'
begin
require 'berkshelf'
rescue LoadError; end

module KnifeSpork
class SporkOmni < Chef::Knife

deps do
require 'knife-spork/runner'
begin
require 'berkshelf'
rescue LoadError; end
end

banner 'knife spork omni COOKBOOK (options)'
Expand Down
6 changes: 3 additions & 3 deletions lib/chef/knife/spork-promote.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
require 'chef/knife'
begin
require 'berkshelf'
rescue LoadError; end

module KnifeSpork
class SporkPromote < Chef::Knife

deps do
require 'chef/exceptions'
require 'knife-spork/runner'
begin
require 'berkshelf'
rescue LoadError; end
end

banner 'knife spork promote ENVIRONMENT COOKBOOK (options)'
Expand Down
5 changes: 4 additions & 1 deletion lib/chef/knife/spork-upload.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
require 'chef/knife'
begin
require 'berkshelf'
rescue LoadError; end

module KnifeSpork
class SporkUpload < Chef::Knife
Expand Down Expand Up @@ -35,7 +38,7 @@ class SporkUpload < Chef::Knife
if defined?(::Berkshelf)
option :berksfile,
:short => '-b',
:long => 'berksfile',
:long => '--berksfile BERKSFILE',
:description => 'Path to a Berksfile to operate off of',
:default => File.join(Dir.pwd, ::Berkshelf::DEFAULT_FILENAME)
end
Expand Down