diff options
author | George Claghorn <george.claghorn@gmail.com> | 2019-01-05 12:04:56 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-05 12:04:56 -0500 |
commit | f99b3c5f9759baffec5c1f7abf74e108e2fb1c77 (patch) | |
tree | 17cb82d8c6a90d5805556c83d8fee68947519d02 /railties | |
parent | a4c01573121f8f4bec561673ccfdaeb53ad68483 (diff) | |
parent | efa89e5b241962e2523e25e70ac4663e886ac1f4 (diff) | |
download | rails-f99b3c5f9759baffec5c1f7abf74e108e2fb1c77.tar.gz rails-f99b3c5f9759baffec5c1f7abf74e108e2fb1c77.tar.bz2 rails-f99b3c5f9759baffec5c1f7abf74e108e2fb1c77.zip |
Merge pull request #34865 from cbandy/node_rails_env
Respect Rails.env when running `rails yarn:install`
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/tasks/yarn.rake | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/railties/lib/rails/tasks/yarn.rake b/railties/lib/rails/tasks/yarn.rake index 4fb8586b69..48a8d8e143 100644 --- a/railties/lib/rails/tasks/yarn.rake +++ b/railties/lib/rails/tasks/yarn.rake @@ -6,8 +6,7 @@ namespace :yarn do # Install only production deps when for not usual envs. valid_node_envs = %w[test development production] node_env = ENV.fetch("NODE_ENV") do - rails_env = ENV["RAILS_ENV"] - valid_node_envs.include?(rails_env) ? rails_env : "production" + valid_node_envs.include?(Rails.env) ? Rails.env : "production" end system({ "NODE_ENV" => node_env }, "#{Rails.root}/bin/yarn install --no-progress --frozen-lockfile") end |