mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-20 23:56:12 +00:00
IDE to run CLI with auto assigned port (#673)
* get daemon port from CLI stdout * config-service to use CLI daemon port * updating LS * fixed tests * fix upload blocked when selectedBoard.port is undefined * bump arduino-cli to 0.20.2 Co-authored-by: Alberto Iannaccone <a.iannaccone@arduino.cc>
This commit is contained in:
@@ -21,8 +21,7 @@ export abstract class GrpcClientProvider<C> {
|
||||
@postConstruct()
|
||||
protected init(): void {
|
||||
const updateClient = () => {
|
||||
const cliConfig = this.configService.cliConfiguration;
|
||||
this.reconcileClient(cliConfig ? cliConfig.daemon.port : undefined);
|
||||
this.reconcileClient();
|
||||
};
|
||||
this.configService.onConfigChange(updateClient);
|
||||
this.daemon.ready.then(updateClient);
|
||||
@@ -44,9 +43,9 @@ export abstract class GrpcClientProvider<C> {
|
||||
}
|
||||
}
|
||||
|
||||
protected async reconcileClient(
|
||||
port: string | number | undefined
|
||||
): Promise<void> {
|
||||
protected async reconcileClient(): Promise<void> {
|
||||
const port = await this.daemon.getPort();
|
||||
|
||||
if (this._port === port) {
|
||||
return; // Nothing to do.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user