Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 90046c9

Browse filesBrowse files
author
Alberto Iannaccone
committed
at first ide startup invoke installation of arduino:avr
1 parent 835e991 commit 90046c9
Copy full SHA for 90046c9

File tree

Expand file treeCollapse file tree

1 file changed

+16
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+16
-0
lines changed

‎arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx

Copy file name to clipboardExpand all lines: arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
ContextMenuRenderer,
1212
FrontendApplication,
1313
FrontendApplicationContribution,
14+
LocalStorageService,
1415
OpenerService,
1516
StatusBar,
1617
StatusBarAlignment,
@@ -79,6 +80,8 @@ import { FileChangeType } from '@theia/filesystem/lib/browser';
7980
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
8081
import { SketchbookWidgetContribution } from './widgets/sketchbook/sketchbook-widget-contribution';
8182

83+
const INIT_AVR_PACKAGES = 'initializedAvrPackages';
84+
8285
@injectable()
8386
export class ArduinoFrontendContribution
8487
implements
@@ -199,13 +202,26 @@ export class ArduinoFrontendContribution
199202
@inject(FrontendApplicationStateService)
200203
protected readonly appStateService: FrontendApplicationStateService;
201204

205+
@inject(LocalStorageService)
206+
protected readonly localStorageService: LocalStorageService;
207+
202208
protected invalidConfigPopup:
203209
| Promise<void | 'No' | 'Yes' | undefined>
204210
| undefined;
205211
protected toDisposeOnStop = new DisposableCollection();
206212

207213
@postConstruct()
208214
protected async init(): Promise<void> {
215+
const notFirstStartup = await this.localStorageService.getData(
216+
INIT_AVR_PACKAGES
217+
);
218+
if (!notFirstStartup) {
219+
await this.localStorageService.setData(INIT_AVR_PACKAGES, true);
220+
const avrPackage = await this.boardsService.getBoardPackage({
221+
id: 'arduino:avr',
222+
});
223+
avrPackage && (await this.boardsService.install({ item: avrPackage }));
224+
}
209225
if (!window.navigator.onLine) {
210226
// tslint:disable-next-line:max-line-length
211227
this.messageService.warn(

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.