@@ -17,32 +17,34 @@ interface ClippyResult {
17
17
exitCode : number ;
18
18
}
19
19
20
- async function buildContext ( program : Program ) : Promise < Context > {
20
+ async function buildContext ( program : Program , toolchain : string | undefined ) : Promise < Context > {
21
21
const context : Context = {
22
22
cargo : "" ,
23
23
clippy : "" ,
24
24
rustc : "" ,
25
25
} ;
26
26
27
+ toolchain = `+${ toolchain } ` ?? "" ;
28
+
27
29
await Promise . all ( [
28
- await exec . exec ( "rustc" , [ "-V" ] , {
29
- silent : true ,
30
+ await exec . exec ( "rustc" , [ toolchain , "-V" ] , {
31
+ silent : false ,
30
32
listeners : {
31
33
stdout : ( buffer : Buffer ) => {
32
34
return ( context . rustc = buffer . toString ( ) . trim ( ) ) ;
33
35
} ,
34
36
} ,
35
37
} ) ,
36
- await program . call ( [ "-V" ] , {
37
- silent : true ,
38
+ await program . call ( [ toolchain , "-V" ] , {
39
+ silent : false ,
38
40
listeners : {
39
41
stdout : ( buffer : Buffer ) => {
40
42
return ( context . cargo = buffer . toString ( ) . trim ( ) ) ;
41
43
} ,
42
44
} ,
43
45
} ) ,
44
- await program . call ( [ "clippy" , "-V" ] , {
45
- silent : true ,
46
+ await program . call ( [ toolchain , "clippy" , "-V" ] , {
47
+ silent : false ,
46
48
listeners : {
47
49
stdout : ( buffer : Buffer ) => {
48
50
return ( context . clippy = buffer . toString ( ) . trim ( ) ) ;
@@ -99,7 +101,7 @@ function getProgram(useCross: boolean): Promise<Program> {
99
101
export async function run ( actionInput : input . ParsedInput ) : Promise < void > {
100
102
const program : Program = await getProgram ( actionInput . useCross ) ;
101
103
102
- const context = await buildContext ( program ) ;
104
+ const context = await buildContext ( program , actionInput . toolchain ) ;
103
105
104
106
const { stats, annotations, exitCode } = await runClippy ( actionInput , program ) ;
105
107
0 commit comments