Skip to content

Commit

Permalink
[rust] rust wants nightlies marked with dash not dot
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Dec 28, 2023
1 parent 16fd13b commit 9a700e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -903,20 +903,21 @@ namespace :rust do
task :version, [:version] do |_task, arguments|
old_version = rust_version.dup
equivalent_version = if old_version.include?('nightly')
old_version.split('.')[0...-1].tap(&:shift).append('0').append('nightly').join('.')
"#{old_version.split(/\.|-/)[0...-1].tap(&:shift).join('.')}.0-nightly"
else
old_version.split('.').tap(&:shift).append('0').join('.')
end
converted_version = updated_version(equivalent_version, arguments[:version])
new_version = converted_version.split('.').unshift("0").tap(&:pop).join('.')
new_version += '.nightly' unless old_version.include?('nightly')
new_version += '-nightly' unless old_version.include?('nightly')

['rust/Cargo.toml', 'rust/BUILD.bazel'].each do |file|
text = File.read(file).gsub(old_version, new_version)
File.open(file, "w") { |f| f.puts text }
end

Rake::Task['rust:changelog'].invoke unless new_version.include?('nightly')
Rake::Task['rust:update'].invoke
end
end

Expand Down
2 changes: 1 addition & 1 deletion rust/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ rust_binary(
name = "selenium-manager",
srcs = ["src/main.rs"],
edition = "2021",
version = "0.4.17.nightly",
version = "0.4.17-nightly",
visibility = ["//visibility:public"],
deps = [
":selenium_manager",
Expand Down
2 changes: 1 addition & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "selenium-manager"
version = "0.4.17.nightly" # don't forget to update rust/BUILD.bazel
version = "0.4.17-nightly" # don't forget to update rust/BUILD.bazel
edition = "2021"
authors = ["Selenium <[email protected]"]
license = "Apache-2.0"
Expand Down

0 comments on commit 9a700e2

Please sign in to comment.