Skip to content

Commit

Permalink
Properly convert --requirements-update-strategy value to Enum
Browse files Browse the repository at this point in the history
  • Loading branch information
noorul committed Jan 21, 2025
1 parent d6d0437 commit 8dd19c1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bin/dry-run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,13 @@
opts_req_desc = "Options: lockfile_only, auto, widen_ranges, bump_versions or " \
"bump_versions_if_necessary"
opts.on("--requirements-update-strategy STRATEGY", opts_req_desc) do |value|
value = nil if value == "auto"
$options[:requirements_update_strategy] = value
if value == "auto"
$options[:requirements_update_strategy] = nil
else
strategy = Dependabot::RequirementsUpdateStrategy.values.find { |v| v.serialize == value } or
raise OptionParser::InvalidArgument, "Invalid requirements update strategy: #{value}. #{opts_req_desc}"
$options[:requirements_update_strategy] = strategy
end
end

opts.on("--commit COMMIT", "Commit to fetch dependency files from") do |value|
Expand Down

0 comments on commit 8dd19c1

Please sign in to comment.