简体   繁体   中英

How to login to heroku from c9 using shell script?

Heroku provides cli commands. They have heroku login command which can be run in linux to login to heroku. After executing the command heroku login, it asks for heroku login and password using prompts. I want to login using an automated script.

let's say I have a bash script named login.sh.

I am trying to login to heroku account from cloud9 ide when I run this script. ./login.sh

Inside login.sh is the command

heroku login

So far I have tried

echo -e "valid@email.com\npassword\n" | ./test.sh 

First of all, are you sure you really need an automatic heroku login script? You shouldn't need to login to heroku every time you open your cloud9 workspace. Only the first time after the workspace is created / restarts.

If you really do need an automatic login script, one way to do it is to write a short expect script. You will probably need to do install expect in your C9 workspace.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM