cf-service-connect
cf-service-connect copied to clipboard
gracefully handle the REPL being missing
trafficstars
Closes #48. Builds on #44 - diff.
If the REPL corresponding to the desired service can't be found, fall back to -no-client behavior.
$ which psql
psql not found
$ cf connect-to-service myapp mydb
Finding the service instance details...
Setting up SSH tunnel...
SSH tunnel created.
Executable `psql` not found.
Falling back to `-no-client` behavior.
Skipping call to client CLI. Connection information:
Host: localhost
Port: 58923
Username: myuser
Password: mypass
Name: dbname
To connect:
PGPASSWORD=mypass psql -h localhost -p 58923 dbname myuser
Leave this terminal open while you want to use the SSH tunnel. Press Control-C to stop.