console1984
console1984 copied to clipboard
Add reason using environment variable
Redirecting long scripts to Heroku breaks due to the required input reason e.g.
# -- input
echo "puts 'hello'" > <local_directory_path>/test.rb
cat <local_directory_path>/test.rb | heroku run "CONSOLE_USER=Jarrad rails c" --no-tty
# -- output
Jarrad, why are you using this console today?
Loading production environment (Rails 7.2.2)
Switch to inspect mode.
# -- exits here without the redirected puts
Similar to CONSOLE_USER, I was wondering whether we could add another environment variable, CONSOLE_REASON for example, that supplies the reason value and skips the input e.g.
module Console1984::InputOutput
private
....
def ask_for_session_reason
return ENV['CONSOLE_REASON'] if ENV['CONSOLE_REASON'].present?
...
end
end
end
If there's another way to solve this without any library changes that would be preferred! 🙏