mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-06-05 19:56:34 +00:00
Fixed lib uninstall. Do not log it more than once.
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
parent
0a8b6bc41e
commit
62b18ccbed
@ -2,7 +2,17 @@ import * as PQueue from 'p-queue';
|
||||
import { injectable, inject, postConstruct, named } from 'inversify';
|
||||
import { ILogger } from '@theia/core/lib/common/logger';
|
||||
import { BoardsService, AttachedSerialBoard, BoardPackage, Board, AttachedNetworkBoard, BoardsServiceClient, Port } from '../common/protocol/boards-service';
|
||||
import { PlatformSearchReq, PlatformSearchResp, PlatformInstallReq, PlatformInstallResp, PlatformListReq, PlatformListResp, Platform, PlatformUninstallReq } from './cli-protocol/commands/core_pb';
|
||||
import {
|
||||
PlatformSearchReq,
|
||||
PlatformSearchResp,
|
||||
PlatformInstallReq,
|
||||
PlatformInstallResp,
|
||||
PlatformListReq,
|
||||
PlatformListResp,
|
||||
Platform,
|
||||
PlatformUninstallReq,
|
||||
PlatformUninstallResp
|
||||
} from './cli-protocol/commands/core_pb';
|
||||
import { CoreClientProvider } from './core-client-provider';
|
||||
import { BoardListReq, BoardListResp } from './cli-protocol/commands/board_pb';
|
||||
import { ToolOutputServiceServer } from '../common/protocol/tool-output-service';
|
||||
@ -304,13 +314,14 @@ export class BoardsServiceImpl implements BoardsService {
|
||||
req.setPlatformPackage(platform);
|
||||
|
||||
console.info("Starting board uninstallation", pkg);
|
||||
let logged = false;
|
||||
const resp = client.platformUninstall(req);
|
||||
resp.on('data', (r: PlatformInstallResp) => {
|
||||
const prog = r.getProgress();
|
||||
if (prog && prog.getFile()) {
|
||||
this.toolOutputService.publishNewOutput("board uninstall", `uninstalling ${prog.getFile()}\n`)
|
||||
resp.on('data', (_: PlatformUninstallResp) => {
|
||||
if (!logged) {
|
||||
this.toolOutputService.publishNewOutput("board uninstall", `uninstalling ${pkg.id}\n`)
|
||||
logged = true;
|
||||
}
|
||||
});
|
||||
})
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
resp.on('end', resolve);
|
||||
resp.on('error', reject);
|
||||
|
@ -2,8 +2,16 @@ import { injectable, inject } from 'inversify';
|
||||
import { Library, LibraryService } from '../common/protocol/library-service';
|
||||
import { CoreClientProvider } from './core-client-provider';
|
||||
import {
|
||||
LibrarySearchReq, LibrarySearchResp, LibraryListReq, LibraryListResp, LibraryRelease,
|
||||
InstalledLibrary, LibraryInstallReq, LibraryInstallResp, LibraryUninstallReq
|
||||
LibrarySearchReq,
|
||||
LibrarySearchResp,
|
||||
LibraryListReq,
|
||||
LibraryListResp,
|
||||
LibraryRelease,
|
||||
InstalledLibrary,
|
||||
LibraryInstallReq,
|
||||
LibraryInstallResp,
|
||||
LibraryUninstallReq,
|
||||
LibraryUninstallResp
|
||||
} from './cli-protocol/commands/lib_pb';
|
||||
import { ToolOutputServiceServer } from '../common/protocol/tool-output-service';
|
||||
import { Installable } from '../common/protocol/installable';
|
||||
@ -103,11 +111,12 @@ export class LibraryServiceImpl implements LibraryService {
|
||||
req.setName(library.name);
|
||||
req.setVersion(library.installedVersion!);
|
||||
|
||||
const resp = client.libraryInstall(req);
|
||||
resp.on('data', (r: LibraryInstallResp) => {
|
||||
const prog = r.getProgress();
|
||||
if (prog) {
|
||||
this.toolOutputService.publishNewOutput("library uninstall", `uninstalling ${prog.getFile()}: ${prog.getCompleted()}%\n`)
|
||||
let logged = false;
|
||||
const resp = client.libraryUninstall(req);
|
||||
resp.on('data', (_: LibraryUninstallResp) => {
|
||||
if (!logged) {
|
||||
this.toolOutputService.publishNewOutput("library uninstall", `uninstalling ${library.name}:${library.installedVersion}%\n`)
|
||||
logged = true;
|
||||
}
|
||||
});
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user