Merge pull request #44910 from jonathanhefner/credentials-avoid-escaping-paths
Avoid escaping paths when editing credentials
This commit is contained in:
commit
38d5846e06
@ -92,7 +92,7 @@ def ensure_credentials_have_been_added
|
||||
|
||||
def change_credentials_in_system_editor
|
||||
credentials.change do |tmp_path|
|
||||
system("#{ENV["EDITOR"]} #{Shellwords.escape(tmp_path)}")
|
||||
system(*Shellwords.split(ENV["EDITOR"]), tmp_path.to_s)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -36,7 +36,7 @@ class Rails::Command::CredentialsCommandTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
test "edit command does not overwrite by default if credentials already exists" do
|
||||
run_edit_command(editor: "eval echo api_key: abc >")
|
||||
run_edit_command(editor: 'ruby -e "File.write ARGV[0], %(api_key: abc)"')
|
||||
assert_match(/api_key: abc/, run_show_command)
|
||||
|
||||
run_edit_command
|
||||
|
Loading…
Reference in New Issue
Block a user