summaryrefslogtreecommitdiff
path: root/node_modules/electron-packager/src/download.js
diff options
context:
space:
mode:
authorLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 22:54:37 +0300
committerLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 22:54:37 +0300
commit703e03aba33f234712206769f57717ba7d92d23d (patch)
tree0041f04ccb75bd5379c764e9fe42249fffe75fc3 /node_modules/electron-packager/src/download.js
parentab6e257e6e9d9a483d7e86f220d8b209a2cd7753 (diff)
downloadFlashRunner-703e03aba33f234712206769f57717ba7d92d23d.tar.gz
FlashRunner-703e03aba33f234712206769f57717ba7d92d23d.tar.zst
Added export_allowed file to make repository visible in cgit
Diffstat (limited to 'node_modules/electron-packager/src/download.js')
-rw-r--r--node_modules/electron-packager/src/download.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/node_modules/electron-packager/src/download.js b/node_modules/electron-packager/src/download.js
new file mode 100644
index 0000000..9c104a0
--- /dev/null
+++ b/node_modules/electron-packager/src/download.js
@@ -0,0 +1,37 @@
+'use strict'
+
+const common = require('./common')
+const debug = require('debug')('electron-packager')
+const { downloadArtifact } = require('@electron/get')
+const semver = require('semver')
+const targets = require('./targets')
+
+function createDownloadOpts (opts, platform, arch) {
+ const downloadOpts = { ...opts.download }
+
+ common.subOptionWarning(downloadOpts, 'download', 'platform', platform, opts.quiet)
+ common.subOptionWarning(downloadOpts, 'download', 'arch', arch, opts.quiet)
+ common.subOptionWarning(downloadOpts, 'download', 'version', opts.electronVersion, opts.quiet)
+ common.subOptionWarning(downloadOpts, 'download', 'artifactName', 'electron', opts.quiet)
+
+ return downloadOpts
+}
+
+module.exports = {
+ createDownloadCombos: function createDownloadCombos (opts, selectedPlatforms, selectedArchs, ignoreFunc) {
+ return targets.createPlatformArchPairs(opts, selectedPlatforms, selectedArchs, ignoreFunc).map(([platform, arch]) => {
+ return createDownloadOpts(opts, platform, arch)
+ })
+ },
+ createDownloadOpts: createDownloadOpts,
+ downloadElectronZip: async function downloadElectronZip (downloadOpts) {
+ // armv7l builds have only been backfilled for Electron >= 1.0.0.
+ // See: https://github.com/electron/electron/pull/6986
+ /* istanbul ignore if */
+ if (downloadOpts.arch === 'armv7l' && semver.lt(downloadOpts.version, '1.0.0')) {
+ downloadOpts.arch = 'arm'
+ }
+ debug(`Downloading Electron with options ${JSON.stringify(downloadOpts)}`)
+ return downloadArtifact(downloadOpts)
+ }
+}