mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 13:05:32 +09:00
feat(desktop): add FLUXER_DISABLE_MODULE_UPDATES opt-out (#3466)
This commit is contained in:
1 parent
e8dff6a8a1
commit
e403fb6cce
11 files changed
+302
-77
No files matched your search
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
const {execFile} = require('node:child_process');
|
||||
const {readFileSync} = require('node:fs');
|
||||
const fs = require('node:fs/promises');
|
||||
const os = require('node:os');
|
||||
const path = require('node:path');
|
||||
@@ -102,6 +103,7 @@ const isMacBuild = process.argv.includes('--mac');
|
||||
const isWindowsBuild = process.argv.includes('--win');
|
||||
const targetPlatform = isLinuxBuild ? 'linux' : isMacBuild ? 'darwin' : isWindowsBuild ? 'win32' : process.platform;
|
||||
const metadataName = isLinuxBuild ? linuxPackageName : packageName;
|
||||
const shellVersion = process.env.VERSION || readBundledRendererVersion();
|
||||
const supportedTargetArchs = ['x64', 'arm64'];
|
||||
const supportedMacTargetArchs = [...supportedTargetArchs, 'universal'];
|
||||
const electronArch = process.env.ELECTRON_ARCH;
|
||||
@@ -644,6 +646,15 @@ function packagePathParts(packageName) {
|
||||
return [packageName];
|
||||
}
|
||||
|
||||
function readBundledRendererVersion() {
|
||||
try {
|
||||
const {version} = JSON.parse(readFileSync(path.join(__dirname, 'dist', 'renderer', 'version.json'), 'utf8'));
|
||||
return typeof version === 'string' && /^\d+\.\d+\.\d+$/u.test(version) ? version : null;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function isNonEmptyString(value) {
|
||||
return typeof value === 'string' && value.length > 0;
|
||||
}
|
||||
@@ -1623,7 +1634,7 @@ module.exports = {
|
||||
extraMetadata: {
|
||||
main: 'dist/main/index.js',
|
||||
name: metadataName,
|
||||
...(process.env.VERSION ? {version: process.env.VERSION} : {}),
|
||||
...(shellVersion ? {version: shellVersion} : {}),
|
||||
...(targetPlatform === 'linux' ? {desktopName: `${linuxDesktopId}.desktop`} : {}),
|
||||
},
|
||||
extraResources: [
|
||||
|
||||
Reference in new issue
Block a user