mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-19 09:16:38 +00:00
Merge pull request #3208 from balena-io/update-etcher-sdk-4.1.13
Update etcher sdk 4.1.13
This commit is contained in:
commit
2aedea3139
@ -17,6 +17,7 @@
|
||||
import { delay } from 'bluebird';
|
||||
import * as electron from 'electron';
|
||||
import { autoUpdater } from 'electron-updater';
|
||||
import { promises as fs } from 'fs';
|
||||
import { platform } from 'os';
|
||||
import * as _ from 'lodash';
|
||||
import * as path from 'path';
|
||||
@ -57,7 +58,17 @@ async function checkForUpdates(interval: number) {
|
||||
}
|
||||
}
|
||||
|
||||
function getCommandLineURL(argv: string[]): string | undefined {
|
||||
async function isFile(filePath: string): Promise<boolean> {
|
||||
try {
|
||||
const stat = await fs.stat(filePath);
|
||||
return stat.isFile();
|
||||
} catch {
|
||||
// noop
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
async function getCommandLineURL(argv: string[]): Promise<string | undefined> {
|
||||
argv = argv.slice(electron.app.isPackaged ? 1 : 2);
|
||||
if (argv.length) {
|
||||
const value = argv[argv.length - 1];
|
||||
@ -69,6 +80,14 @@ function getCommandLineURL(argv: string[]): string | undefined {
|
||||
if (platform() === 'darwin' && value.startsWith('-psn_')) {
|
||||
return;
|
||||
}
|
||||
if (
|
||||
!value.startsWith('http://') &&
|
||||
!value.startsWith('https://') &&
|
||||
!value.startsWith(scheme) &&
|
||||
!(await isFile(value))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@ -204,9 +223,9 @@ async function main(): Promise<void> {
|
||||
window.restore();
|
||||
}
|
||||
window.focus();
|
||||
await selectImageURL(getCommandLineURL(argv));
|
||||
await selectImageURL(await getCommandLineURL(argv));
|
||||
});
|
||||
await selectImageURL(getCommandLineURL(process.argv));
|
||||
await selectImageURL(await getCommandLineURL(process.argv));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ async function writeAndValidate({
|
||||
onProgress,
|
||||
verify,
|
||||
trim: autoBlockmapping,
|
||||
numBuffers: 32,
|
||||
numBuffers: Math.min(2 + (destinations.length - 1) * 32, 256),
|
||||
decompressFirst,
|
||||
});
|
||||
const result: WriteResult = {
|
||||
|
6
npm-shrinkwrap.json
generated
6
npm-shrinkwrap.json
generated
@ -5355,9 +5355,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"etcher-sdk": {
|
||||
"version": "4.1.8",
|
||||
"resolved": "https://registry.npmjs.org/etcher-sdk/-/etcher-sdk-4.1.8.tgz",
|
||||
"integrity": "sha512-fSNwpqeCdc75xNIKwf+At8+r/EQ+/X/IV7gUYFa/wKXtnFHHxYJor6VfPdELUbtDDBWWa2cneJvtwGmcDPBAvA==",
|
||||
"version": "4.1.13",
|
||||
"resolved": "https://registry.npmjs.org/etcher-sdk/-/etcher-sdk-4.1.13.tgz",
|
||||
"integrity": "sha512-ITzBgoy8AGI6/DHyS43wix2TNa9kVeILsr/vQl75Hbbt5gM4C2ygwqABG7V+MGTaNphWc2OstSP9k6xQpGfttw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@ronomon/direct-io": "^3.0.1",
|
||||
|
@ -77,7 +77,7 @@
|
||||
"electron-notarize": "^0.3.0",
|
||||
"electron-rebuild": "^1.11.0",
|
||||
"electron-updater": "^4.3.2",
|
||||
"etcher-sdk": "^4.1.8",
|
||||
"etcher-sdk": "^4.1.13",
|
||||
"file-loader": "^6.0.0",
|
||||
"flexboxgrid": "^6.3.0",
|
||||
"husky": "^4.2.5",
|
||||
|
Loading…
x
Reference in New Issue
Block a user