mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-10-20 16:48:33 +00:00
[ATL-1531] Integrate arduino-cli 0.19.1 (#506)
* integrate cli 0.19.0 * Update CLI version used to fix crash on lib/core install/uninstall * Update CLI version * Update CLI version * update cli version Co-authored-by: Silvano Cerza <silvanocerza@gmail.com>
This commit is contained in:
committed by
GitHub
parent
ba177be41d
commit
7f8b227c39
@@ -42,8 +42,7 @@ import { InstallWithProgress } from './grpc-installable';
|
||||
@injectable()
|
||||
export class BoardsServiceImpl
|
||||
extends CoreClientAware
|
||||
implements BoardsService
|
||||
{
|
||||
implements BoardsService {
|
||||
@inject(ILogger)
|
||||
protected logger: ILogger;
|
||||
|
||||
@@ -75,6 +74,7 @@ export class BoardsServiceImpl
|
||||
async getBoardDetails(options: {
|
||||
fqbn: string;
|
||||
}): Promise<BoardDetails | undefined> {
|
||||
await this.coreClientProvider.initialized;
|
||||
const coreClient = await this.coreClient();
|
||||
const { client, instance } = coreClient;
|
||||
const { fqbn } = options;
|
||||
@@ -165,13 +165,13 @@ export class BoardsServiceImpl
|
||||
|
||||
let VID = 'N/A';
|
||||
let PID = 'N/A';
|
||||
const usbId = detailsResp
|
||||
.getIdentificationPrefsList()
|
||||
.map((item) => item.getUsbId())
|
||||
const prop = detailsResp
|
||||
.getIdentificationPropertiesList()
|
||||
.map((item) => item.getPropertiesMap())
|
||||
.find(notEmpty);
|
||||
if (usbId) {
|
||||
VID = usbId.getVid();
|
||||
PID = usbId.getPid();
|
||||
if (prop) {
|
||||
VID = prop.get('vid') || '';
|
||||
PID = prop.get('pid') || '';
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -214,6 +214,7 @@ export class BoardsServiceImpl
|
||||
}: {
|
||||
query?: string;
|
||||
}): Promise<BoardWithPackage[]> {
|
||||
await this.coreClientProvider.initialized;
|
||||
const { instance, client } = await this.coreClient();
|
||||
const req = new BoardSearchRequest();
|
||||
req.setSearchArgs(query || '');
|
||||
@@ -244,6 +245,7 @@ export class BoardsServiceImpl
|
||||
}
|
||||
|
||||
async search(options: { query?: string }): Promise<BoardsPackage[]> {
|
||||
await this.coreClientProvider.initialized;
|
||||
const coreClient = await this.coreClient();
|
||||
const { client, instance } = coreClient;
|
||||
|
||||
@@ -361,6 +363,7 @@ export class BoardsServiceImpl
|
||||
const version = !!options.version
|
||||
? options.version
|
||||
: item.availableVersions[0];
|
||||
await this.coreClientProvider.initialized;
|
||||
const coreClient = await this.coreClient();
|
||||
const { client, instance } = coreClient;
|
||||
|
||||
@@ -382,7 +385,10 @@ export class BoardsServiceImpl
|
||||
})
|
||||
);
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
resp.on('end', resolve);
|
||||
resp.on('end', () => {
|
||||
this.boardDiscovery.startBoardListWatch(coreClient)
|
||||
resolve();
|
||||
});
|
||||
resp.on('error', (error) => {
|
||||
this.responseService.appendToOutput({
|
||||
chunk: `Failed to install platform: ${item.id}.\n`,
|
||||
@@ -406,6 +412,7 @@ export class BoardsServiceImpl
|
||||
progressId?: string;
|
||||
}): Promise<void> {
|
||||
const { item, progressId } = options;
|
||||
await this.coreClientProvider.initialized;
|
||||
const coreClient = await this.coreClient();
|
||||
const { client, instance } = coreClient;
|
||||
|
||||
@@ -426,7 +433,10 @@ export class BoardsServiceImpl
|
||||
})
|
||||
);
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
resp.on('end', resolve);
|
||||
resp.on('end', () => {
|
||||
this.boardDiscovery.startBoardListWatch(coreClient)
|
||||
resolve();
|
||||
});
|
||||
resp.on('error', reject);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user