mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-25 17:25:16 +03:00
Added support for ChromeOS.
This commit is contained in:
parent
357b6c0998
commit
b15a391113
2 changed files with 44 additions and 16 deletions
31
gulpfile.js
31
gulpfile.js
|
@ -26,9 +26,9 @@ var releaseDir = './release/';
|
||||||
|
|
||||||
// Get platform from commandline args
|
// Get platform from commandline args
|
||||||
// #
|
// #
|
||||||
// # gulp <task> [<platform>]+ Run only for platform(s) (with <platform> one of --linux64, --osx64, or --win32)
|
// # gulp <task> [<platform>]+ Run only for platform(s) (with <platform> one of --linux64, --osx64, or --win32 --chromeos)
|
||||||
// #
|
// #
|
||||||
function getPlatforms() {
|
function getPlatforms(includeChromeOs) {
|
||||||
var supportedPlatforms = ['linux64', 'osx64', 'win32'];
|
var supportedPlatforms = ['linux64', 'osx64', 'win32'];
|
||||||
var platforms = [];
|
var platforms = [];
|
||||||
var regEx = /--(\w+)/;
|
var regEx = /--(\w+)/;
|
||||||
|
@ -36,6 +36,10 @@ function getPlatforms() {
|
||||||
var arg = process.argv[i].match(regEx)[1];
|
var arg = process.argv[i].match(regEx)[1];
|
||||||
if (supportedPlatforms.indexOf(arg) > -1) {
|
if (supportedPlatforms.indexOf(arg) > -1) {
|
||||||
platforms.push(arg);
|
platforms.push(arg);
|
||||||
|
} else if (arg === 'chromeos') {
|
||||||
|
if (includeChromeOs) {
|
||||||
|
platforms.push(arg);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('Unknown platform: ' + arg);
|
console.log('Unknown platform: ' + arg);
|
||||||
process.exit();
|
process.exit();
|
||||||
|
@ -83,7 +87,8 @@ function getRunDebugAppCommand() {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -333,6 +338,20 @@ function release_linux64() {
|
||||||
return archive.finalize();
|
return archive.finalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create distribution package for chromeos platform
|
||||||
|
function release_chromeos() {
|
||||||
|
var src = distDir;
|
||||||
|
var output = fs.createWriteStream(path.join(releaseDir, get_release_filename('chromeos', 'zip')));
|
||||||
|
var archive = archiver('zip', {
|
||||||
|
zlib: { level: 9 }
|
||||||
|
});
|
||||||
|
archive.on('warning', function (err) { throw err; });
|
||||||
|
archive.on('error', function (err) { throw err; });
|
||||||
|
archive.pipe(output);
|
||||||
|
archive.directory(src, false);
|
||||||
|
return archive.finalize();
|
||||||
|
}
|
||||||
|
|
||||||
// Create distribution package for macOS platform
|
// Create distribution package for macOS platform
|
||||||
function release_osx64() {
|
function release_osx64() {
|
||||||
var appdmg = require('gulp-appdmg');
|
var appdmg = require('gulp-appdmg');
|
||||||
|
@ -370,9 +389,13 @@ gulp.task('release', ['apps', 'clean-release'], function () {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var platforms = getPlatforms();
|
var platforms = getPlatforms(true);
|
||||||
console.log('Packing release.');
|
console.log('Packing release.');
|
||||||
|
|
||||||
|
if (platforms.indexOf('chromeos') !== -1) {
|
||||||
|
release_chromeos();
|
||||||
|
}
|
||||||
|
|
||||||
if (platforms.indexOf('linux64') !== -1) {
|
if (platforms.indexOf('linux64') !== -1) {
|
||||||
release_linux64();
|
release_linux64();
|
||||||
}
|
}
|
||||||
|
|
29
main.js
29
main.js
|
@ -28,7 +28,9 @@ $(document).ready(function () {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
checkForConfiguratorUpdates();
|
if (GUI.operating_system !== 'ChromeOS') {
|
||||||
|
checkForConfiguratorUpdates();
|
||||||
|
}
|
||||||
|
|
||||||
chrome.storage.local.get('logopen', function (result) {
|
chrome.storage.local.get('logopen', function (result) {
|
||||||
if (result.logopen) {
|
if (result.logopen) {
|
||||||
|
@ -202,20 +204,23 @@ $(document).ready(function () {
|
||||||
}).change();
|
}).change();
|
||||||
});
|
});
|
||||||
|
|
||||||
chrome.storage.local.get('checkForConfiguratorUnstableVersions', function (result) {
|
if (GUI.operating_system !== 'ChromeOS') {
|
||||||
$('div.checkForConfiguratorUnstableVersions input').change(function () {
|
chrome.storage.local.get('checkForConfiguratorUnstableVersions', function (result) {
|
||||||
var checked = $(this).is(':checked');
|
if (result.checkForConfiguratorUnstableVersions) {
|
||||||
|
$('div.checkForConfiguratorUnstableVersions input').prop('checked', true);
|
||||||
|
}
|
||||||
|
|
||||||
chrome.storage.local.set({'checkForConfiguratorUnstableVersions': checked});
|
$('div.checkForConfiguratorUnstableVersions input').change(function () {
|
||||||
|
var checked = $(this).is(':checked');
|
||||||
|
|
||||||
$('input[name="checkForConfiguratorUnstableVersions"]').prop('checked', checked).change();
|
chrome.storage.local.set({'checkForConfiguratorUnstableVersions': checked});
|
||||||
checkForConfiguratorUpdates();
|
|
||||||
|
checkForConfiguratorUpdates();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
if (result.checkForConfiguratorUnstableVersions) {
|
$('div.checkForConfiguratorUnstableVersions').hide();
|
||||||
$('div.checkForConfiguratorUnstableVersions input').prop('checked', true);
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function close_and_cleanup(e) {
|
function close_and_cleanup(e) {
|
||||||
if (e.type == 'click' && !$.contains($('div#options-window')[0], e.target) || e.type == 'keyup' && e.keyCode == 27) {
|
if (e.type == 'click' && !$.contains($('div#options-window')[0], e.target) || e.type == 'keyup' && e.keyCode == 27) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue