Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Switch fly version

I work with a lot of different Concourse servers that have a variety of versions. fly rejects working with servers that are off to much. Therefore I have fly-3.14.1, fly-4.2.3 etc. on my machine.

But many set-pipeline scripts assume that a single fly command exists and that it magically is of the right version. So I need to switch; preferably per directory or per shell.

Did not work

  • Shell aliases are never exported, so that a set-pipeline script does not know about the alias.
  • I use ZSH, where functions cannot be exported.

Works

Symlinks:

ln -sf /usr/local/bin/fly{-3.14.1,}

Unfortunately, this is a machine-wide setting.

Potential Approaches

  • Move the various fly versions to different subdirectories, and adjust the $PATH (perhaps in a .envrc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment