File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -20,26 +20,25 @@ import * as vscode from "vscode";
20
20
import { Version } from "../utilities/version" ;
21
21
import { z } from "zod" ;
22
22
23
- const ListAvailableResult = z . object ( {
23
+ const ListResult = z . object ( {
24
24
toolchains : z . array (
25
25
z . object ( {
26
26
inUse : z . boolean ( ) ,
27
- installed : z . boolean ( ) ,
28
27
isDefault : z . boolean ( ) ,
29
- name : z . string ( ) ,
30
28
version : z . discriminatedUnion ( "type" , [
31
29
z . object ( {
32
30
major : z . number ( ) ,
33
31
minor : z . number ( ) ,
34
32
patch : z . number ( ) . optional ( ) ,
33
+ name : z . string ( ) ,
35
34
type : z . literal ( "stable" ) ,
36
35
} ) ,
37
36
z . object ( {
38
37
major : z . number ( ) ,
39
38
minor : z . number ( ) ,
40
39
branch : z . string ( ) ,
41
40
date : z . string ( ) ,
42
-
41
+ name : z . string ( ) ,
43
42
type : z . literal ( "snapshot" ) ,
44
43
} ) ,
45
44
] ) ,
@@ -97,9 +96,9 @@ export class Swiftly {
97
96
outputChannel ?: vscode . OutputChannel
98
97
) : Promise < string [ ] > {
99
98
try {
100
- const { stdout } = await execFile ( "swiftly" , [ "list-available " , "--format=json" ] ) ;
101
- const response = ListAvailableResult . parse ( JSON . parse ( stdout ) ) ;
102
- return response . toolchains . map ( t => t . name ) ;
99
+ const { stdout } = await execFile ( "swiftly" , [ "list" , "--format=json" ] ) ;
100
+ const response = ListResult . parse ( JSON . parse ( stdout ) ) ;
101
+ return response . toolchains . map ( t => t . version . name ) ;
103
102
} catch ( error ) {
104
103
outputChannel ?. appendLine ( `Failed to retrieve Swiftly installations: ${ error } ` ) ;
105
104
throw new Error (
You can’t perform that action at this time.
0 commit comments