mirror of https://github.com/rails/rails
Fix release script to publish the ujs package
This commit is contained in:
parent
23243eb283
commit
ad9037aab8
|
@ -16,6 +16,8 @@ FRAMEWORKS = %w(
|
|||
railties
|
||||
)
|
||||
FRAMEWORK_NAMES = Hash.new { |h, k| k.split(/(?<=active|action)/).map(&:capitalize).join(" ") }
|
||||
NPM_PACKAGES = { "actionview" => "ujs" }
|
||||
NPM_PACKAGES.default_proc = -> (_, framework) { framework }
|
||||
|
||||
root = File.expand_path("..", __dir__)
|
||||
version = File.read("#{root}/RAILS_VERSION").strip
|
||||
|
@ -121,7 +123,7 @@ npm_version = version.gsub(/\./).with_index { |s, i| i >= 2 ? "-" : s }
|
|||
if /[a-z]/.match?(version)
|
||||
npm_tag = " --tag pre"
|
||||
else
|
||||
remote_package_version = `npm view @rails/#{framework}@latest version`.chomp
|
||||
remote_package_version = `npm view @rails/#{NPM_PACKAGES[framework]}@latest version`.chomp
|
||||
local_major_version = version.split(".", 4)[0]
|
||||
remote_major_version = remote_package_version.split(".", 4)[0]
|
||||
npm_tag = remote_major_version <= local_major_version ? " --tag latest" : " --tag v#{local_major_version}"
|
||||
|
|
Loading…
Reference in New Issue