From b64fe2d2f78a03f686f14e336ad27192bc908e54 Mon Sep 17 00:00:00 2001 From: Sander Botman Date: Fri, 1 Nov 2013 21:57:40 +0100 Subject: [PATCH] fixing the version bump within the choose_version function. --- lib/chef/knife/github_deploy.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/chef/knife/github_deploy.rb b/lib/chef/knife/github_deploy.rb index 37bc8fd..59a7655 100644 --- a/lib/chef/knife/github_deploy.rb +++ b/lib/chef/knife/github_deploy.rb @@ -236,13 +236,20 @@ def choose_version(version) major = $1 minor = $2 patch = $3 - major = major.to_i + 1 if config[:major] - minor = minor.to_i + 1 if config[:minor] + if config[:major] + major = major.to_i + 1 + minor = 0 + patch = 0 + end + if config[:minor] + minor = minor.to_i + 1 + patch = 0 + end patch = patch.to_i + 1 if config[:patch] version = "#{major}.#{minor}.#{patch}" Chef::Log.debug("New version is #{version}") else - Chef::Log.error("Version is in a format I cannot auto auto-update") + Chef::Log.error("Version is in a format I cannot auto-update") exit 1 end version