Is it possible to script the following on OSX?
heroku run console
load 'init.rb'
The following does not work:
alias 'heroku_init=heroku run console; load "init.rb"'
It seems that the shell has to wait for the Heroku console to connect, or needs a way to send the load
command to the Heroku console instead of the bash shell.
Big ups to camilo-santana for the answer:
It can also be done with an alias:
What you want it to send
load 'init.rb'
to the standard input of theheroku run console
program. You do that in the shell using the pipe operator:This works but notice it makes the console hang, if you want to input some more commands manually you can do:
Hope this helps ;)