diff options
author | Chris Bandy <bandy.chris@gmail.com> | 2019-01-04 11:54:47 -0600 |
---|---|---|
committer | Chris Bandy <bandy.chris@gmail.com> | 2019-01-04 11:54:47 -0600 |
commit | efa89e5b241962e2523e25e70ac4663e886ac1f4 (patch) | |
tree | 58aaaabf133621b5322330590656708bb0b4f6d6 | |
parent | 663f6cc14fd01650546ed508efb3f7ad8e30135c (diff) | |
download | rails-efa89e5b241962e2523e25e70ac4663e886ac1f4.tar.gz rails-efa89e5b241962e2523e25e70ac4663e886ac1f4.tar.bz2 rails-efa89e5b241962e2523e25e70ac4663e886ac1f4.zip |
Respect Rails.env when running `rails yarn:install`
When no environment variables are set the expectation is that we are in
development.
-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 |