Skip to content

Add reason using environment variable #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
JDrizzy opened this issue Feb 13, 2025 · 0 comments
Open

Add reason using environment variable #132

JDrizzy opened this issue Feb 13, 2025 · 0 comments

Comments

@JDrizzy
Copy link

JDrizzy commented Feb 13, 2025

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! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant