Closed samwho closed 4 years ago
If you use a TTY::Command and have a % in one of your environment variables, you will get a malformed format string error.
malformed format string
require 'tty-command' cmd = TTY::Command.new cmd.run("true", env: { "foo": "%16" })
Traceback (most recent call last): 7: from /tmp/test.rb:3:in `<main>' 6: from /Users/sam/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/tty-command-0.9.0/lib/tty/command.rb:104:in `run' 5: from /Users/sam/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/tty-command-0.9.0/lib/tty/command.rb:185:in `execute_command' 4: from /Users/sam/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/tty-command-0.9.0/lib/tty/command/process_runner.rb:41:in `run!' 3: from /Users/sam/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/tty-command-0.9.0/lib/tty/command/printers/pretty.rb:20:in `print_command_start' 2: from /Users/sam/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/tty-command-0.9.0/lib/tty/command/cmd.rb:121:in `to_command' 1: from /Users/sam/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/tty-command-0.9.0/lib/tty/command/cmd.rb:87:in `evars' /Users/sam/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/tty-command-0.9.0/lib/tty/command/cmd.rb:87:in `%': malformed format string - %" (ArgumentError)
The command to return successfully with no error.
Thanks so much for the quick turnaround on this. 🙏
Describe the problem
If you use a TTY::Command and have a % in one of your environment variables, you will get a
malformed format string
error.Steps to reproduce the problem
Actual behaviour
Expected behaviour
The command to return successfully with no error.
Describe your environment