From f81f840c02cff34c169e6fca348fab9a372c8372 Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Sun, 11 Jun 2017 12:22:39 +0200 Subject: Access EDITOR through Ruby's cross-platform ENV. Fix the mistake of not using Ruby's ENV hash from the get go and get windows support. --- railties/lib/rails/commands/secrets/secrets_command.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/railties/lib/rails/commands/secrets/secrets_command.rb b/railties/lib/rails/commands/secrets/secrets_command.rb index 651411d444..5f077a5bcb 100644 --- a/railties/lib/rails/commands/secrets/secrets_command.rb +++ b/railties/lib/rails/commands/secrets/secrets_command.rb @@ -31,7 +31,7 @@ module Rails require_application_and_environment! Rails::Secrets.read_for_editing do |tmp_path| - system("\$EDITOR #{tmp_path}") + system("#{ENV["EDITOR"]} #{tmp_path}") end say "New secrets encrypted and saved." @@ -43,7 +43,7 @@ module Rails raise unless error.message =~ /secrets\.yml\.enc/ Rails::Secrets.read_template_for_editing do |tmp_path| - system("\$EDITOR #{tmp_path}") + system("#{ENV["EDITOR"]} #{tmp_path}") generator.skip_secrets_file { setup } end end -- cgit v1.2.3