Skip to content

Commit 343925c

Browse files
committed
add auto update preferences
1 parent db373c8 commit 343925c

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed

arduino-ide-extension/src/browser/arduino-preferences.ts

+13-3
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,20 @@ export const ArduinoConfigSchema: PreferenceSchema = {
6666
},
6767
'arduino.ide.autoUpdate': {
6868
type: 'boolean',
69+
default: true,
6970
description: nls.localize(
7071
'arduino/preferences/ide.autoUpdate',
71-
'True to enable automatic update checks. The IDE will check for updates automatically and periodically.'
72+
'True to enable automatic updates'
73+
),
74+
},
75+
'arduino.ide.updateChannel': {
76+
type: 'string',
77+
enum: ['latest', 'nightly', 'none'],
78+
default: 'none',
79+
description: nls.localize(
80+
'arduino/preferences/ide.updateChannel',
81+
'Release channel to get updated from. Latest is the stable release, nightly is the latest development build.'
7282
),
73-
default: true,
7483
},
7584
'arduino.board.certificates': {
7685
type: 'string',
@@ -171,7 +180,8 @@ export interface ArduinoConfiguration {
171180
'arduino.upload.verify': boolean;
172181
'arduino.window.autoScale': boolean;
173182
'arduino.window.zoomLevel': number;
174-
'arduino.ide.autoUpdate': boolean;
183+
'arduino.window.autoUpdate': boolean;
184+
'arduino.ide.updateChannel': 'latest' | 'nightly' | 'none';
175185
'arduino.board.certificates': string;
176186
'arduino.sketchbook.showAllFiles': boolean;
177187
'arduino.cloud.enabled': boolean;

electron/packager/config.js

+21
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,19 @@ function getVersion() {
8383
return version;
8484
}
8585

86+
function getChannel() {
87+
88+
if (isRelease) {
89+
return 'latest';
90+
}
91+
if (isNightly) {
92+
return 'nightly';
93+
}
94+
95+
return 'none';
96+
97+
}
98+
8699
function timestamp() {
87100
return dateFormat(new Date(), 'yyyymmdd');
88101
}
@@ -101,10 +114,18 @@ function generateTemplate(buildDate) {
101114
const version = getVersion();
102115
const productName = 'Arduino IDE';
103116
const name = 'arduino-ide';
117+
const updateChannel = getChannel();
104118
let customizations = {
105119
name,
106120
description: productName,
107121
version,
122+
theia: {
123+
frontend: {
124+
config: {
125+
"arduino.ide.updateChannel": updateChannel
126+
}
127+
}
128+
},
108129
build: {
109130
productName,
110131
appId: 'cc.arduino.IDE2',

0 commit comments

Comments
 (0)