I think something similar could be done in upgrade. May be like this:
$ gofish upgrade terraform
==> Rigs updated!
NAME
github.com/fishworks/fish-food
🐠 rigs updated in 2.34935729s
==> terraform: no installed versions to upgrade
🐠 Everything up to date!
I had installed
terraform
manually. Assuming I had installed it usinggofish
, I ran upgrade and got this errorOn noticing, I saw that it fails at this line https://github.com/fishworks/gofish/blob/6b8aaa5bf6362c8f945080b257c2a50a336eada1/cmd/gofish/upgrade.go#L38 where there's a safe assumption that there will be at least one installed version, but that's not true, as the length of
installedVersions
has not been checked here https://github.com/fishworks/gofish/blob/6b8aaa5bf6362c8f945080b257c2a50a336eada1/cmd/gofish/upgrade.go#L28 as compared to other usages offindFoodVersions
, for example ininfo
command where it clearly gives an error that there are no installed versions https://github.com/fishworks/gofish/blob/9251fee4a28007ae5374fbae0607bb4a7b0839e2/cmd/gofish/info.go#L33I think something similar could be done in upgrade. May be like this: