-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Bumping version with -M -m will need some extra logic within this function.
def choose_version(version)
if version =~ /(\d+)\.(\d+)\.(\d+)/
major = $1
minor = $2
patch = $3
major = major.to_i + 1 if config[:major]
minor = minor.to_i + 1 if config[:minor]
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")
exit 1
end
version
end
Example, my current version is: 1.3.5
Bumping patch with -p will result into: 1.3.6 (seems ok)
Bumping minor with -m will result into: 1.4.5 (not ok, should be 1.4.0)
Bumping major with -M will result into: 2.3.5 (not ok, should be 2.0.0)
Metadata
Metadata
Assignees
Labels
No labels