1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Handle paths with spaces when editing credentials

Fixes https://github.com/rails/rails/issues/41617

Co-authored-by: Alexander Riccio <alexander@riccio.com>
Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
This commit is contained in:
Alex Ghiculescu 2021-07-07 14:48:20 -05:00
parent 317547e0e7
commit 5ca37eae12

View file

@ -1,6 +1,7 @@
# frozen_string_literal: true
require "pathname"
require "shellwords"
require "active_support"
require "rails/command/helpers/editor"
require "rails/command/environment_argument"
@ -91,7 +92,7 @@ module Rails
def change_credentials_in_system_editor
credentials.change do |tmp_path|
system("#{ENV["EDITOR"]} #{tmp_path}")
system("#{ENV["EDITOR"]} #{Shellwords.escape(tmp_path)}")
end
end