inUse Set To A Missing Toolchain Should Be Recoverable
I got myself into a mess, such that the config.json had inUse set to a toolchain which didn't exist in ~/.local/share/swiftly/toolchains/.
This left me in a state where swiftly refused to switch to a toolchain that did exist and was correctly installed in ~/.local/share/swiftly/toolchains.
Hand-editing the config.json to remove the inUse entry was enough to get things working again.
Swiftly really ought to be able to detect this situation for itself, and recover (possibly after confirming with the user).
During this recovery it should also update installedToolchains by removing any entries that don't exist in the filesystem.
Note: I'm not expecting magic here, or for it to detect a damaged or partial toolchain folder. If it's totally missing however, it would be good if one wasn't left in a state where nothing worked!
Alternatively, or in addition, there could be some kind of install --force or repair option which re-installed a toolchain even though swiftly thought it was already installed.
Thank you for reporting this. Swiftly should do better to reconcile differences between its config.json and the state in the filesystem.
This should be fixed with the latest swiftly release. Please reopen if this is still happening for you.