Skip to content

Add reason using environment variable #132

Description

@JDrizzy

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions