Skip to content

Commit

Permalink
Fixing bug for #186 where single quoted cookbook names would cause er…
Browse files Browse the repository at this point in the history
…rors
  • Loading branch information
jonlives committed Aug 18, 2015
1 parent c3104f8 commit 33e628a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.6.1(18th August, 2015)

Bugfixes:

- Fix bug in automatic bump command when cookbook name is single quoted in metadata.rb

## 1.6.0(18th August, 2015)

Features:
Expand Down
2 changes: 1 addition & 1 deletion knife-spork.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $:.push File.expand_path('../lib', __FILE__)

Gem::Specification.new do |gem|
gem.name = 'knife-spork'
gem.version = '1.6.0'
gem.version = '1.6.1'
gem.authors = ["Jon Cowie"]
gem.email = 'jonlives@gmail.com'
gem.homepage = 'https://github.com/jonlives/knife-spork'
Expand Down
2 changes: 1 addition & 1 deletion lib/chef/knife/spork-bump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def run
cookbook_name = ""

if @name_args.empty? && File.exists?("#{Dir.pwd}/metadata.rb")
cookbook_name = File.read("#{Dir.pwd}/metadata.rb").split("\n").select{|l|l.start_with?("name")}.first.split.last.gsub("\"","")
cookbook_name = File.read("#{Dir.pwd}/metadata.rb").split("\n").select{|l|l.start_with?("name")}.first.split.last.gsub("\"","").gsub("'","")
ui.info "Cookbook name omitted, but metadata.rb for cookbook #{cookbook_name} found - bumping that."
elsif @name_args.empty?
show_usage
Expand Down

0 comments on commit 33e628a

Please sign in to comment.