configure updater options

This commit is contained in:
Alberto Iannaccone
2021-12-21 12:56:23 +01:00
parent 44d31abc7f
commit db373c825c
2 changed files with 17 additions and 15 deletions

View File

@@ -1,4 +1,9 @@
import { Command, CommandContribution, CommandRegistry } from '@theia/core';
import {
Command,
CommandContribution,
CommandRegistry,
MessageService,
} from '@theia/core';
import { injectable, inject } from 'inversify';
import { IDEUpdaterService } from '../../common/protocol/ide-updater-service';
@@ -6,7 +11,9 @@ import { IDEUpdaterService } from '../../common/protocol/ide-updater-service';
export class IDEUpdaterCommands implements CommandContribution {
constructor(
@inject(IDEUpdaterService)
private readonly updater: IDEUpdaterService
private readonly updater: IDEUpdaterService,
@inject(MessageService)
protected readonly messageService: MessageService
) {}
registerCommands(registry: CommandRegistry): void {
@@ -24,8 +31,9 @@ export class IDEUpdaterCommands implements CommandContribution {
});
}
checkForUpdates() {
this.updater.checkForUpdates();
async checkForUpdates() {
const info = await this.updater.checkForUpdates();
this.messageService.info(`version ${info.version} available`);
}
downloadUpdate() {

View File

@@ -1,5 +1,5 @@
import { injectable } from '@theia/core/shared/inversify';
import { AllPublishOptions } from 'builder-util-runtime';
import { GenericServerOptions } from 'builder-util-runtime';
import {
AppUpdater,
AppImageUpdater,
@@ -21,17 +21,11 @@ export class IDEUpdaterServiceImpl implements IDEUpdaterService {
protected theiaFEClient?: IDEUpdaterServiceClient;
constructor() {
const options: AllPublishOptions = {
provider: 's3',
bucket: '',
region: '',
acl: 'public-read',
endpoint: 'https://{service}.{region}.amazonaws.com',
channel: '',
const options: GenericServerOptions = {
provider: 'generic',
url: 'https://downloads.arduino.cc/arduino-ide/nightly/test/',
channel: 'beta',
};
// TODO: Search S3 bucket name for the two channels
// https://downloads.arduino.cc/arduino-ide/arduino-ide_2.0.0-rc2_Linux_64bit.zip
// https://downloads.arduino.cc/arduino-ide/nightly/arduino-ide_nightly-latest_Linux_64bit.zip
this.cancellationToken = new CancellationToken();
if (process.platform === 'win32') {