Skip to content

Commit

Permalink
Merge pull request #44910 from jonathanhefner/credentials-avoid-escap…
Browse files Browse the repository at this point in the history
…ing-paths

Avoid escaping paths when editing credentials
  • Loading branch information
byroot committed May 9, 2022
2 parents f19e896 + 2f66df0 commit 38d5846
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion railties/test/commands/credentials_test.rb
Expand Up @@ -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
Expand Down

0 comments on commit 38d5846

Please sign in to comment.