Skip to content
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

logs.clear removes prompt #87

Open
schneems opened this issue Dec 3, 2024 · 0 comments
Open

logs.clear removes prompt #87

schneems opened this issue Dec 3, 2024 · 0 comments

Comments

@schneems
Copy link
Member

schneems commented Dec 3, 2024

This

  ```term
  :::>> print.erb
  $ heroku run:inside <%= `heroku ps --json | jq -r ".[0].name"`.strip %> "launcher bash"
  :::-- background.start('heroku run:inside $(heroku ps --json | jq -r ".[0].name") "launcher bash"', wait: "$", timeout: 120, name: "heroku_run")
  :::-- background.stdin_write("ruby -v", name: "heroku_run", wait: "$", timeout: 30)
  :::-- background.stdin_write("rails -v", name: "heroku_run", wait: "$", timeout: 30)
  :::-- background.stdin_write("ls -lah", name: "heroku_run", wait: "$", timeout: 30)
  :::-> background.log.read(name: "heroku_run")
  :::-- background.log.clear(name: "heroku_run")
  ```
  
  If you receive an error, `Error connecting to process`, [configure your firewall](https://devcenter.heroku.com/articles/troubleshooting-one-off-dynos-awaiting-process-timeout-issues).
  
  You can run any command this way such as `launcher rails console` or `launcher rake db:migrate`. Type `exit` to exit the shell and terminate the dyno:
  
  ```term
  :::-- background.stdin_write("exit", name: "heroku_run", wait: "exit")
  :::-> background.stop(name: "heroku_run")
  ```

Produces this output:

  drwxr-xr-x. 3 heroku heroku   20 Jan  1  1980 vendor
  heroku@web-549d786c64-c65nv:/workspace$ ruby -v
  ruby 3.2.4 (2024-04-23 revision af471c0e01) [aarch64-linux]
  heroku@web-549d786c64-c65nv:/workspace$ rails -v
  Rails 7.1.3.2
  heroku@web-549d786c64-c65nv:/workspace$
  ```
  <!-- STOP. This document is autogenerated. Do not manually modify. See the top of the doc for more details. -->
  
  If you receive an error, `Error connecting to process`, [configure your firewall](https://devcenter.heroku.com/articles/troubleshooting-one-off-dynos-awaiting-process-timeout-issues).
  
  You can run any command this way such as `launcher rails console` or `launcher rake db:migrate`. Type `exit` to exit the shell and terminate the dyno:
  
  ```term
  exit
  exit
  ```

Because of the way I'm clearing the logs between the invocations it gets rid of the prompt. Maybe an argument that preserves the last N lines? I'm not sure what to call it though.

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