Skip to content

Commit 9ecff86

Browse files
authored
Fix version retrieval in node process (#837)
1 parent 5ab3a74 commit 9ecff86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arduino-ide-extension/src/node/grpc-client-provider.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { inject, injectable, postConstruct } from 'inversify';
2-
import { app } from 'electron';
32
import { ILogger } from '@theia/core/lib/common/logger';
43
import { MaybePromise } from '@theia/core/lib/common/types';
54
import { ConfigServiceImpl } from './config-service-impl';
@@ -71,10 +70,11 @@ export abstract class GrpcClientProvider<C> {
7170
protected abstract close(client: C): void;
7271

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

0 commit comments

Comments
 (0)