mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
check yarn version and run correct install command
This commit is contained in:
parent
45d1efab51
commit
bd4d8fdfce
1 changed files with 9 additions and 1 deletions
|
@ -8,7 +8,15 @@ namespace :yarn do
|
|||
node_env = ENV.fetch("NODE_ENV") do
|
||||
valid_node_envs.include?(Rails.env) ? Rails.env : "production"
|
||||
end
|
||||
system({ "NODE_ENV" => node_env }, "#{Rails.root}/bin/yarn install --no-progress --frozen-lockfile")
|
||||
|
||||
yarn_flags =
|
||||
if `#{Rails.root}/bin/yarn --version`.start_with?("1")
|
||||
"--no-progress --frozen-lockfile"
|
||||
else
|
||||
"--immutable"
|
||||
end
|
||||
|
||||
system({ "NODE_ENV" => node_env }, "#{Rails.root}/bin/yarn install #{yarn_flags}")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue