@@ -9,9 +9,9 @@ export async function installReviewdog(tag: string, directory: string): Promise<
9
9
const version = await tagToVersion ( tag , owner , repo ) ;
10
10
11
11
// get the os information
12
- let platform = process . platform . toString ( ) ;
12
+ let platform : string ;
13
13
let ext = "" ;
14
- switch ( platform ) {
14
+ switch ( process . platform ) {
15
15
case "darwin" :
16
16
platform = "Darwin" ;
17
17
break ;
@@ -23,22 +23,20 @@ export async function installReviewdog(tag: string, directory: string): Promise<
23
23
ext = ".exe" ;
24
24
break ;
25
25
default :
26
- throw new Error ( `unsupported platform: ${ platform } ` ) ;
26
+ throw new Error ( `unsupported platform: ${ process . platform } ` ) ;
27
27
}
28
28
29
29
// get the arch information
30
- let arch = process . arch ;
31
- switch ( arch ) {
30
+ let arch : string ;
31
+ switch ( process . arch ) {
32
32
case "x64" :
33
33
arch = "x86_64" ;
34
34
break ;
35
35
case "arm64" :
36
- break ;
37
- case "x32" :
38
- arch = "i386" ;
36
+ arch = "arm64" ;
39
37
break ;
40
38
default :
41
- throw new Error ( `unsupported arch: ${ arch } ` ) ;
39
+ throw new Error ( `unsupported arch: ${ process . arch } ` ) ;
42
40
}
43
41
44
42
const url = `https://github.com/${ owner } /${ repo } /releases/download/v${ version } /reviewdog_${ version } _${ platform } _${ arch } .tar.gz` ;
@@ -56,36 +54,36 @@ export async function installGolangciLint(tag: string, directory: string): Promi
56
54
const version = await tagToVersion ( tag , owner , repo ) ;
57
55
58
56
// get the os information
59
- let platform = process . platform . toString ( ) ;
57
+ let platform : string ;
60
58
let ext = "" ;
61
59
let archive = "tar.gz" ;
62
- switch ( platform ) {
60
+ switch ( process . platform ) {
63
61
case "darwin" :
62
+ platform = "darwin" ;
64
63
break ;
65
64
case "linux" :
65
+ platform = "linux" ;
66
66
break ;
67
67
case "win32" :
68
68
platform = "windows" ;
69
69
ext = ".exe" ;
70
70
archive = "zip" ;
71
71
break ;
72
72
default :
73
- throw new Error ( `unsupported platform: ${ platform } ` ) ;
73
+ throw new Error ( `unsupported platform: ${ process . platform } ` ) ;
74
74
}
75
75
76
76
// get the arch information
77
- let arch = process . arch ;
78
- switch ( arch ) {
77
+ let arch : string ;
78
+ switch ( process . arch ) {
79
79
case "x64" :
80
80
arch = "amd64" ;
81
81
break ;
82
82
case "arm64" :
83
- break ;
84
- case "x32" :
85
- arch = "386" ;
83
+ arch = "arm64" ;
86
84
break ;
87
85
default :
88
- throw new Error ( `unsupported arch: ${ arch } ` ) ;
86
+ throw new Error ( `unsupported arch: ${ process . arch } ` ) ;
89
87
}
90
88
91
89
const url = `https://github.com/${ owner } /${ repo } /releases/download/v${ version } /golangci-lint-${ version } -${ platform } -${ arch } .${ archive } ` ;
0 commit comments