Skip to content

Instantly share code, notes, and snippets.

@mdelillo
Created June 4, 2018 21:13
Show Gist options
  • Save mdelillo/2883473eda55ebee3f9b29d6a9bcb722 to your computer and use it in GitHub Desktop.
Save mdelillo/2883473eda55ebee3f9b29d6a9bcb722 to your computer and use it in GitHub Desktop.
Use your browser to automatically log in to fly
login-fly ()
{
expect <(cat <<EOF
spawn fly -t credhub login
expect "1: GitHub"
send -- "1\r"
expect -re "https://.*fly_local_port=\[0-9\]*"
set url [ string map { "\&" "\\\&" } \$expect_out(0,string) ]
system open \$url
expect eof
EOF
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment