File tree Expand file tree Collapse file tree 1 file changed +3
-22
lines changed Expand file tree Collapse file tree 1 file changed +3
-22
lines changed Original file line number Diff line number Diff line change @@ -237,30 +237,11 @@ export let formatCode = (
237
237
}
238
238
} ;
239
239
240
- export let findReScriptVersion = async (
241
- filePath : p . DocumentUri
242
- ) : Promise < string | undefined > => {
243
- let projectRoot = findProjectRootOfFile ( filePath ) ;
244
- if ( projectRoot == null ) {
240
+ export async function findReScriptVersionForProjectRoot ( projectRootPath : string | null ) : Promise < string | undefined > {
241
+ if ( projectRootPath == null ) {
245
242
return undefined ;
246
243
}
247
244
248
- const bscExe = findBinary ( findPlatformPath ( projectRoot ) , c . bscExeName ) ;
249
-
250
- if ( bscExe == null ) {
251
- return undefined ;
252
- }
253
-
254
- try {
255
- let version = childProcess . execSync ( `${ bscExe } -v` ) ;
256
- return version . toString ( ) . replace ( / r e s c r i p t / gi, "" ) . trim ( ) ;
257
- } catch ( e ) {
258
- console . error ( "rescrip binary failed" , e ) ;
259
- return undefined ;
260
- }
261
- } ;
262
-
263
- export async function findReScriptVersionForProjectRoot ( projectRootPath : string ) : Promise < string | undefined > {
264
245
const bscExe = await findBscExeBinary ( projectRootPath )
265
246
266
247
if ( bscExe == null ) {
@@ -294,7 +275,7 @@ export let runAnalysisAfterSanityCheck = async (
294
275
}
295
276
let rescriptVersion =
296
277
projectsFiles . get ( projectRootPath ?? "" ) ?. rescriptVersion ??
297
- await findReScriptVersion ( filePath ) ;
278
+ await findReScriptVersionForProjectRoot ( projectRootPath )
298
279
299
280
let binaryPath = builtinBinaryPath ;
300
281
You can’t perform that action at this time.
0 commit comments