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"
36
37
"@types/glob" : " 8.0.0" ,
37
38
"@types/request-promise-native" : " 1.0.18" ,
38
39
"@types/turndown" : " 5.0.1" ,
39
- "@types/urijs" : " 1.19.19"
40
+ "@types/urijs" : " 1.19.19" ,
41
+ "@types/which" : " 2.0.1"
40
42
}
41
43
}
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 62
62
resolved "https://registry.yarnpkg.com/@types/urijs/-/urijs-1.19.19.tgz#2789369799907fc11e2bc6e3a00f6478c2281b95"
63
63
integrity sha512-FDJNkyhmKLw7uEvTxx5tSXfPeQpO0iy73Ry+PmYZJvQy0QIWX8a7kJ4kLWRf+EbTPJEPDSgPXHaM7pzr5lmvCg==
64
64
65
+ " @types/which@2.0.1 " :
66
+ version "2.0.1"
67
+ resolved "https://registry.yarnpkg.com/@types/which/-/which-2.0.1.tgz#27ecd67f915b7c3d6ba552135bb1eecd66e63501"
68
+ integrity sha512-Jjakcv8Roqtio6w1gr0D7y6twbhx6gGgFGF5BLwajPpnOIOxFkakFhCq+LmyyeAz7BX6ULrjBOxdKaCDy+4+dQ==
69
+
65
70
ajv@^5.1.0 :
66
71
version "5.5.2"
67
72
resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965"
@@ -286,6 +291,11 @@ is-typedarray@~1.0.0:
286
291
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
287
292
integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=
288
293
294
+ isexe@^2.0.0 :
295
+ version "2.0.0"
296
+ resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
297
+ integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==
298
+
289
299
isstream@~0.1.2 :
290
300
version "0.1.2"
291
301
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
@@ -543,6 +553,13 @@ web-tree-sitter@^0.20.5:
543
553
resolved "https://registry.yarnpkg.com/web-tree-sitter/-/web-tree-sitter-0.20.5.tgz#62c8ea29d94f6ef6f03ce9c68c860df011ee26c7"
544
554
integrity sha512-mpXlqIeEBE5Q71cnBnt8w6XKhIiKmllPECqsIFBtMvzcfCxA8+614iyMJXBCQo95Vs3y1zORLqiLJn25pYZ4Tw==
545
555
556
+ which@^2.0.2 :
557
+ version "2.0.2"
558
+ resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
559
+ integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==
560
+ dependencies :
561
+ isexe "^2.0.0"
562
+
546
563
wrappy@1 :
547
564
version "1.0.2"
548
565
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
You can’t perform that action at this time.
0 commit comments