Skip to content

Commit

Permalink
Fix version retrieval in node process (#837)
Browse files Browse the repository at this point in the history
  • Loading branch information
silvanocerza authored Feb 15, 2022
1 parent 5ab3a74 commit 9ecff86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arduino-ide-extension/src/node/grpc-client-provider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { inject, injectable, postConstruct } from 'inversify';
import { app } from 'electron';
import { ILogger } from '@theia/core/lib/common/logger';
import { MaybePromise } from '@theia/core/lib/common/types';
import { ConfigServiceImpl } from './config-service-impl';
Expand Down Expand Up @@ -71,10 +70,11 @@ export abstract class GrpcClientProvider<C> {
protected abstract close(client: C): void;

protected get channelOptions(): Record<string, unknown> {
const pjson = require('../../package.json') || { "version": "0.0.0" }
return {
'grpc.max_send_message_length': 512 * 1024 * 1024,
'grpc.max_receive_message_length': 512 * 1024 * 1024,
'grpc.primary_user_agent': `arduino-ide/${app.getVersion()}`
'grpc.primary_user_agent': `arduino-ide/${pjson.version}`
};
}
}

0 comments on commit 9ecff86

Please # to comment.