Skip to content

Commit 5ca37ea

Browse files
ghiculescuaricciojonathanhefner
committed
Handle paths with spaces when editing credentials
Fixes rails#41617 Co-authored-by: Alexander Riccio <[email protected]> Co-authored-by: Jonathan Hefner <[email protected]>
1 parent 317547e commit 5ca37ea

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

railties/lib/rails/commands/credentials/credentials_command.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22

33
require "pathname"
4+
require "shellwords"
45
require "active_support"
56
require "rails/command/helpers/editor"
67
require "rails/command/environment_argument"
@@ -91,7 +92,7 @@ def ensure_credentials_have_been_added
9192

9293
def change_credentials_in_system_editor
9394
credentials.change do |tmp_path|
94-
system("#{ENV["EDITOR"]} #{tmp_path}")
95+
system("#{ENV["EDITOR"]} #{Shellwords.escape(tmp_path)}")
9596
end
9697
end
9798

0 commit comments

Comments
 (0)