mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-13 22:36:32 +00:00
at first ide startup invoke installation of arduino:avr (#497)
This commit is contained in:
parent
658c19f55b
commit
bfb90a8b4f
@ -11,6 +11,7 @@ import {
|
||||
ContextMenuRenderer,
|
||||
FrontendApplication,
|
||||
FrontendApplicationContribution,
|
||||
LocalStorageService,
|
||||
OpenerService,
|
||||
StatusBar,
|
||||
StatusBarAlignment,
|
||||
@ -79,6 +80,8 @@ import { FileChangeType } from '@theia/filesystem/lib/browser';
|
||||
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
|
||||
import { SketchbookWidgetContribution } from './widgets/sketchbook/sketchbook-widget-contribution';
|
||||
|
||||
const INIT_AVR_PACKAGES = 'initializedAvrPackages';
|
||||
|
||||
@injectable()
|
||||
export class ArduinoFrontendContribution
|
||||
implements
|
||||
@ -199,6 +202,9 @@ export class ArduinoFrontendContribution
|
||||
@inject(FrontendApplicationStateService)
|
||||
protected readonly appStateService: FrontendApplicationStateService;
|
||||
|
||||
@inject(LocalStorageService)
|
||||
protected readonly localStorageService: LocalStorageService;
|
||||
|
||||
protected invalidConfigPopup:
|
||||
| Promise<void | 'No' | 'Yes' | undefined>
|
||||
| undefined;
|
||||
@ -206,6 +212,16 @@ export class ArduinoFrontendContribution
|
||||
|
||||
@postConstruct()
|
||||
protected async init(): Promise<void> {
|
||||
const notFirstStartup = await this.localStorageService.getData(
|
||||
INIT_AVR_PACKAGES
|
||||
);
|
||||
if (!notFirstStartup) {
|
||||
await this.localStorageService.setData(INIT_AVR_PACKAGES, true);
|
||||
const avrPackage = await this.boardsService.getBoardPackage({
|
||||
id: 'arduino:avr',
|
||||
});
|
||||
avrPackage && (await this.boardsService.install({ item: avrPackage }));
|
||||
}
|
||||
if (!window.navigator.onLine) {
|
||||
// tslint:disable-next-line:max-line-length
|
||||
this.messageService.warn(
|
||||
|
Loading…
x
Reference in New Issue
Block a user