Skip to content

Commit b15a391

Browse files
committed
Added support for ChromeOS.
1 parent 357b6c0 commit b15a391

File tree

2 files changed

+44
-16
lines changed

2 files changed

+44
-16
lines changed

gulpfile.js

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,20 @@ var releaseDir = './release/';
2626

2727
// Get platform from commandline args
2828
// #
29-
// # gulp <task> [<platform>]+ Run only for platform(s) (with <platform> one of --linux64, --osx64, or --win32)
29+
// # gulp <task> [<platform>]+ Run only for platform(s) (with <platform> one of --linux64, --osx64, or --win32 --chromeos)
3030
// #
31-
function getPlatforms() {
31+
function getPlatforms(includeChromeOs) {
3232
var supportedPlatforms = ['linux64', 'osx64', 'win32'];
3333
var platforms = [];
3434
var regEx = /--(\w+)/;
3535
for (var i = 3; i < process.argv.length; i++) {
3636
var arg = process.argv[i].match(regEx)[1];
3737
if (supportedPlatforms.indexOf(arg) > -1) {
3838
platforms.push(arg);
39+
} else if (arg === 'chromeos') {
40+
if (includeChromeOs) {
41+
platforms.push(arg);
42+
}
3943
} else {
4044
console.log('Unknown platform: ' + arg);
4145
process.exit();
@@ -83,7 +87,8 @@ function getRunDebugAppCommand() {
8387
break;
8488

8589
default:
86-
return '';
90+
return '';
91+
8792
break;
8893
}
8994
}
@@ -333,6 +338,20 @@ function release_linux64() {
333338
return archive.finalize();
334339
}
335340

341+
// Create distribution package for chromeos platform
342+
function release_chromeos() {
343+
var src = distDir;
344+
var output = fs.createWriteStream(path.join(releaseDir, get_release_filename('chromeos', 'zip')));
345+
var archive = archiver('zip', {
346+
zlib: { level: 9 }
347+
});
348+
archive.on('warning', function (err) { throw err; });
349+
archive.on('error', function (err) { throw err; });
350+
archive.pipe(output);
351+
archive.directory(src, false);
352+
return archive.finalize();
353+
}
354+
336355
// Create distribution package for macOS platform
337356
function release_osx64() {
338357
var appdmg = require('gulp-appdmg');
@@ -370,9 +389,13 @@ gulp.task('release', ['apps', 'clean-release'], function () {
370389
}
371390
});
372391

373-
var platforms = getPlatforms();
392+
var platforms = getPlatforms(true);
374393
console.log('Packing release.');
375394

395+
if (platforms.indexOf('chromeos') !== -1) {
396+
release_chromeos();
397+
}
398+
376399
if (platforms.indexOf('linux64') !== -1) {
377400
release_linux64();
378401
}

main.js

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ $(document).ready(function () {
2828
break;
2929
}
3030

31-
checkForConfiguratorUpdates();
31+
if (GUI.operating_system !== 'ChromeOS') {
32+
checkForConfiguratorUpdates();
33+
}
3234

3335
chrome.storage.local.get('logopen', function (result) {
3436
if (result.logopen) {
@@ -202,20 +204,23 @@ $(document).ready(function () {
202204
}).change();
203205
});
204206

205-
chrome.storage.local.get('checkForConfiguratorUnstableVersions', function (result) {
206-
$('div.checkForConfiguratorUnstableVersions input').change(function () {
207-
var checked = $(this).is(':checked');
207+
if (GUI.operating_system !== 'ChromeOS') {
208+
chrome.storage.local.get('checkForConfiguratorUnstableVersions', function (result) {
209+
if (result.checkForConfiguratorUnstableVersions) {
210+
$('div.checkForConfiguratorUnstableVersions input').prop('checked', true);
211+
}
208212

209-
chrome.storage.local.set({'checkForConfiguratorUnstableVersions': checked});
213+
$('div.checkForConfiguratorUnstableVersions input').change(function () {
214+
var checked = $(this).is(':checked');
210215

211-
$('input[name="checkForConfiguratorUnstableVersions"]').prop('checked', checked).change();
212-
checkForConfiguratorUpdates();
213-
});
216+
chrome.storage.local.set({'checkForConfiguratorUnstableVersions': checked});
214217

215-
if (result.checkForConfiguratorUnstableVersions) {
216-
$('div.checkForConfiguratorUnstableVersions input').prop('checked', true);
217-
}
218-
});
218+
checkForConfiguratorUpdates();
219+
});
220+
});
221+
} else {
222+
$('div.checkForConfiguratorUnstableVersions').hide();
223+
}
219224

220225
function close_and_cleanup(e) {
221226
if (e.type == 'click' && !$.contains($('div#options-window')[0], e.target) || e.type == 'keyup' && e.keyCode == 27) {

0 commit comments

Comments
 (0)