I often find myself switching between CF installations and wanted an easy way to do it, so I put together this shell function.
Installation is easy, just add it to ~/.profile or save the file and source it.
Usage is like this...
- Run with no arguments to list the current and available environments.
- Run with one argument, to switch to that environment. If the environment doesn't exist, it'll be initialized when you run cf for the first time.
Behind the scenes is nothing earth shattering, it's just adjusting the CF_HOME environment variable using the pattern "$HOME/.cf-<env-name>".
Clean up is easy. You can delete environments by simply deleting the "$HOME/.cf-<env-name>" folder.