swiftly use --format=json returns empty string "" (not to be confused with '""' ), when there are no selected toolchains or installed toolchains:
% swiftly use --format=json
%
|
guard let selectedVersion else { |
|
// Return with nothing if there's no toolchain that is selected |
|
return |
|
} |
No-output is not valid JSON, which trips up tools like the VSCode plugin. An empty object would likely be appropriate here instead.
I can get into this state if I run swiftly uninstall 6.3.2 (pre-installed toolchain) and not having any other toolchains installed and managed by Swiftly.
swiftly use --format=jsonreturns empty string "" (not to be confused with '""' ), when there are no selected toolchains or installed toolchains:swiftly/Sources/Swiftly/Use.swift
Lines 90 to 93 in d166ae1
No-output is not valid JSON, which trips up tools like the VSCode plugin. An empty object would likely be appropriate here instead.
I can get into this state if I run
swiftly uninstall 6.3.2(pre-installed toolchain) and not having any other toolchains installed and managed by Swiftly.