File tree Expand file tree Collapse file tree 3 files changed +23
-15
lines changed Expand file tree Collapse file tree 3 files changed +23
-15
lines changed Original file line number Diff line number Diff line change 26
26
"urijs" : " ^1.19.11" ,
27
27
"vscode-languageserver" : " ^6.1.1" ,
28
28
"vscode-languageserver-textdocument" : " ^1.0.1" ,
29
- "web-tree-sitter" : " ^0.20.5"
29
+ "web-tree-sitter" : " ^0.20.5" ,
30
+ "which" : " ^2.0.2"
30
31
},
31
32
"scripts" : {
32
33
"prepublishOnly" : " cd ../ && yarn run compile"
35
36
"@types/fuzzy-search" : " 2.1.2" ,
36
37
"@types/glob" : " 8.0.0" ,
37
38
"@types/turndown" : " 5.0.1" ,
38
- "@types/urijs" : " 1.19.19"
39
+ "@types/urijs" : " 1.19.19" ,
40
+ "@types/which" : " 2.0.1"
39
41
}
40
42
}
Original file line number Diff line number Diff line change 1
1
import { spawn } from 'child_process'
2
2
import * as LSP from 'vscode-languageserver'
3
+ import which = require( 'which' )
3
4
4
5
import * as config from './config'
5
- import { execShellScript } from './util/sh'
6
6
7
7
function formatMessage ( comment : ShellcheckComment ) : string {
8
8
return ( comment . code ? `SC${ comment . code } : ` : '' ) + comment . message
@@ -14,18 +14,7 @@ type LinterOptions = {
14
14
}
15
15
16
16
export async function getLinterExecutablePath ( ) : Promise < string | null > {
17
- const pathFromConfig = config . getShellcheckPath ( )
18
-
19
- if ( pathFromConfig ) {
20
- return pathFromConfig
21
- }
22
-
23
- try {
24
- const path = ( await execShellScript ( 'which shellcheck' ) ) . trim ( )
25
- return path === '' ? null : path
26
- } catch ( e ) {
27
- return null
28
- }
17
+ return config . getShellcheckPath ( ) || ( await which ( 'shellcheck' ) )
29
18
}
30
19
31
20
export class Linter {
Original file line number Diff line number Diff line change 43
43
resolved "https://registry.yarnpkg.com/@types/urijs/-/urijs-1.19.19.tgz#2789369799907fc11e2bc6e3a00f6478c2281b95"
44
44
integrity sha512-FDJNkyhmKLw7uEvTxx5tSXfPeQpO0iy73Ry+PmYZJvQy0QIWX8a7kJ4kLWRf+EbTPJEPDSgPXHaM7pzr5lmvCg==
45
45
46
+ " @types/which@2.0.1 " :
47
+ version "2.0.1"
48
+ resolved "https://registry.yarnpkg.com/@types/which/-/which-2.0.1.tgz#27ecd67f915b7c3d6ba552135bb1eecd66e63501"
49
+ integrity sha512-Jjakcv8Roqtio6w1gr0D7y6twbhx6gGgFGF5BLwajPpnOIOxFkakFhCq+LmyyeAz7BX6ULrjBOxdKaCDy+4+dQ==
50
+
46
51
asynckit@^0.4.0 :
47
52
version "0.4.0"
48
53
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
@@ -121,6 +126,11 @@ inherits@2:
121
126
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
122
127
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
123
128
129
+ isexe@^2.0.0 :
130
+ version "2.0.0"
131
+ resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
132
+ integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==
133
+
124
134
mime-db@1.52.0 :
125
135
version "1.52.0"
126
136
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70"
@@ -224,6 +234,13 @@ whatwg-url@^5.0.0:
224
234
tr46 "~0.0.3"
225
235
webidl-conversions "^3.0.0"
226
236
237
+ which@^2.0.2 :
238
+ version "2.0.2"
239
+ resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
240
+ integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==
241
+ dependencies :
242
+ isexe "^2.0.0"
243
+
227
244
wrappy@1 :
228
245
version "1.0.2"
229
246
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
You can’t perform that action at this time.
0 commit comments