You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
```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.
The text was updated successfully, but these errors were encountered:
This
Produces this output:
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.
The text was updated successfully, but these errors were encountered: