File tree 1 file changed +5
-3
lines changed
arduino-ide-extension/src/browser/contributions
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 7
7
} from '../../common/protocol' ;
8
8
import { Contribution } from './contribution' ;
9
9
10
+ const Arduino_BuiltIn = 'Arduino_BuiltIn' ;
11
+
10
12
@injectable ( )
11
13
export class FirstStartupInstaller extends Contribution {
12
14
@inject ( LocalStorageService )
@@ -25,8 +27,8 @@ export class FirstStartupInstaller extends Contribution {
25
27
id : 'arduino:avr' ,
26
28
} ) ;
27
29
const builtInLibrary = (
28
- await this . libraryService . search ( { query : ' Arduino_BuiltIn' } )
29
- ) [ 0 ] ;
30
+ await this . libraryService . search ( { query : Arduino_BuiltIn } )
31
+ ) . find ( ( { name } ) => name === Arduino_BuiltIn ) ; // Filter by `name` to ensure "exact match". See: https://github.com/arduino/arduino-ide/issues/1526.
30
32
31
33
let avrPackageError : Error | undefined ;
32
34
let builtInLibraryError : Error | undefined ;
@@ -84,7 +86,7 @@ export class FirstStartupInstaller extends Contribution {
84
86
}
85
87
if ( builtInLibraryError ) {
86
88
this . messageService . error (
87
- `Could not install ${ builtInLibrary . name } library: ${ builtInLibraryError } `
89
+ `Could not install ${ Arduino_BuiltIn } library: ${ builtInLibraryError } `
88
90
) ;
89
91
}
90
92
You can’t perform that action at this time.
0 commit comments