mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 07:17:18 +00:00
commit
0f70c4bbce
10415
.versionbot/CHANGELOG.yml
Normal file
10415
.versionbot/CHANGELOG.yml
Normal file
File diff suppressed because it is too large
Load Diff
@ -74,8 +74,6 @@ function isDrivelistDrive(drive: Drive): drive is DrivelistDrive {
|
||||
const DrivesTable = styled((props: GenericTableProps<Drive>) => (
|
||||
<Table<Drive> {...props} />
|
||||
))`
|
||||
border-bottom: none;
|
||||
|
||||
[data-display='table-head'],
|
||||
[data-display='table-body'] {
|
||||
> [data-display='table-row'] > [data-display='table-cell'] {
|
||||
|
@ -64,19 +64,3 @@ input[type="checkbox"] + div {
|
||||
#rendition-tooltip-root > div {
|
||||
font-family: "SourceSansPro", sans-serif;
|
||||
}
|
||||
|
||||
/* HIGH-CONTRAST CHANGES */
|
||||
input[type="text"],
|
||||
input[type="checkbox"] ~ div,
|
||||
input[type="checkbox"] ~ span {
|
||||
border-color: #b5b5b5 !important;
|
||||
}
|
||||
|
||||
[data-display="table-head"]
|
||||
> [data-display="table-row"]
|
||||
> [data-display="table-cell"],
|
||||
[data-display="table-body"]
|
||||
> [data-display="table-row"]
|
||||
> [data-display="table-cell"] {
|
||||
border-bottom: 1px solid #b5b5b5 !important;
|
||||
}
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import { exec } from 'child_process';
|
||||
import { withTmpFile } from 'etcher-sdk/build/tmp';
|
||||
import { readFile } from 'fs';
|
||||
import { chain, trim } from 'lodash';
|
||||
import { platform } from 'os';
|
||||
@ -22,8 +23,6 @@ import { join } from 'path';
|
||||
import { env } from 'process';
|
||||
import { promisify } from 'util';
|
||||
|
||||
import { withTmpFile } from '../../../shared/tmp';
|
||||
|
||||
const readFileAsync = promisify(readFile);
|
||||
|
||||
const execAsync = promisify(exec);
|
||||
@ -41,11 +40,11 @@ async function getWmicNetworkDrivesOutput(): Promise<string> {
|
||||
// So we just redirect to a file and read it afterwards as we know it will be ucs2 encoded.
|
||||
const options = {
|
||||
// Close the file once it's created
|
||||
discardDescriptor: true,
|
||||
keepOpen: false,
|
||||
// Wmic fails with "Invalid global switch" when the "/output:" switch filename contains a dash ("-")
|
||||
prefix: 'tmp',
|
||||
};
|
||||
return withTmpFile(options, async (path) => {
|
||||
return withTmpFile(options, async ({ path }) => {
|
||||
const command = [
|
||||
join(env.SystemRoot as string, 'System32', 'Wbem', 'wmic'),
|
||||
'path',
|
||||
|
@ -27,6 +27,7 @@ import {
|
||||
OnProgressFunction,
|
||||
OnFailFunction,
|
||||
decompressThenFlash,
|
||||
DECOMPRESSED_IMAGE_PREFIX,
|
||||
} from 'etcher-sdk/build/multi-write';
|
||||
import { cleanupTmpFiles } from 'etcher-sdk/build/tmp';
|
||||
import * as ipc from 'node-ipc';
|
||||
@ -68,7 +69,7 @@ function log(message: string) {
|
||||
*/
|
||||
async function terminate(exitCode: number) {
|
||||
ipc.disconnect(IPC_SERVER_ID);
|
||||
await cleanupTmpFiles(Date.now());
|
||||
await cleanupTmpFiles(Date.now(), DECOMPRESSED_IMAGE_PREFIX);
|
||||
process.nextTick(() => {
|
||||
process.exit(exitCode || SUCCESS);
|
||||
});
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import * as childProcess from 'child_process';
|
||||
import { withTmpFile } from 'etcher-sdk/build/tmp';
|
||||
import { promises as fs } from 'fs';
|
||||
import * as _ from 'lodash';
|
||||
import * as os from 'os';
|
||||
@ -24,7 +25,6 @@ import { promisify } from 'util';
|
||||
|
||||
import { sudo as catalinaSudo } from './catalina-sudo/sudo';
|
||||
import * as errors from './errors';
|
||||
import { withTmpFile } from './tmp';
|
||||
|
||||
const execAsync = promisify(childProcess.exec);
|
||||
const execFileAsync = promisify(childProcess.execFile);
|
||||
@ -172,10 +172,11 @@ export async function elevateCommand(
|
||||
);
|
||||
return await withTmpFile(
|
||||
{
|
||||
keepOpen: false,
|
||||
prefix: 'balena-etcher-electron-',
|
||||
postfix: '.cmd',
|
||||
},
|
||||
async (path) => {
|
||||
async ({ path }) => {
|
||||
await fs.writeFile(path, launchScript);
|
||||
if (isWindows) {
|
||||
return elevateScriptWindows(path, options.applicationName);
|
||||
|
@ -1,27 +0,0 @@
|
||||
import * as tmp from 'tmp';
|
||||
|
||||
function tmpFileAsync(
|
||||
options: tmp.FileOptions,
|
||||
): Promise<{ path: string; cleanup: () => void }> {
|
||||
return new Promise((resolve, reject) => {
|
||||
tmp.file(options, (error, path, _fd, cleanup) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
resolve({ path, cleanup });
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export async function withTmpFile<T>(
|
||||
options: tmp.FileOptions,
|
||||
fn: (path: string) => Promise<T>,
|
||||
): Promise<T> {
|
||||
const { path, cleanup } = await tmpFileAsync(options);
|
||||
try {
|
||||
return await fn(path);
|
||||
} finally {
|
||||
cleanup();
|
||||
}
|
||||
}
|
48
npm-shrinkwrap.json
generated
48
npm-shrinkwrap.json
generated
@ -5173,9 +5173,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"drivelist": {
|
||||
"version": "9.2.2",
|
||||
"resolved": "https://registry.npmjs.org/drivelist/-/drivelist-9.2.2.tgz",
|
||||
"integrity": "sha512-kuigQbvkc9+Y6Rf36d9nv4g4PB19UUPOvxRdQE3JEtggCqdxYCPEsNm6WYOudkfdMIFnHtmbS35QowL/hI/sGQ==",
|
||||
"version": "9.2.4",
|
||||
"resolved": "https://registry.npmjs.org/drivelist/-/drivelist-9.2.4.tgz",
|
||||
"integrity": "sha512-F36yn+qXwiOGZM16FYPKcIRjC7qXDIA0SBZ0vvTEe01ai788Se8z78acYdgXC8NAsghiO+9c/GYXgU7E9hhUpg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"bindings": "^1.3.0",
|
||||
@ -5244,9 +5244,9 @@
|
||||
}
|
||||
},
|
||||
"electron": {
|
||||
"version": "9.4.0",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-9.4.0.tgz",
|
||||
"integrity": "sha512-hOC4q0jkb+UDYZRy8vrZ1IANnq+jznZnbkD62OEo06nU+hIbp2IrwDRBNuSLmQ3cwZMVir0WSIA1qEVK0PkzGA==",
|
||||
"version": "9.4.1",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-9.4.1.tgz",
|
||||
"integrity": "sha512-r4CxoVG9Ja7tBtkilWMnBsBGup8G8Z+v7icZmwysHa8/OSr0OrLjrcOF/30BAP7yPE5fz/XTxygnltzW4OTZdw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@electron/get": "^1.0.1",
|
||||
@ -6114,9 +6114,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"etcher-sdk": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/etcher-sdk/-/etcher-sdk-5.2.1.tgz",
|
||||
"integrity": "sha512-SEJPZ/YsIZgTO+6c5tGeMZLPHRP/KBT1OlMxSSRJS3BXSHDHSvWXjA/UQIw9lfMSyVBrmRZ8pbpkSzCiQkA7nQ==",
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/etcher-sdk/-/etcher-sdk-6.1.0.tgz",
|
||||
"integrity": "sha512-lK4QoFlXJS5km4gH1FlupvR4k5o1ssyUJfG6SQ0jwvLGvEVR/rzbiPocyE1Cfj1LiAyTp2H6L34E7GHPGzc7XQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@balena/udif": "^1.1.1",
|
||||
@ -6128,7 +6128,7 @@
|
||||
"check-disk-space": "^2.1.0",
|
||||
"cyclic-32": "^1.1.0",
|
||||
"debug": "^3.1.0",
|
||||
"drivelist": "^9.2.2",
|
||||
"drivelist": "^9.2.4",
|
||||
"file-disk": "^8.0.1",
|
||||
"file-type": "^8.0.0",
|
||||
"gzip-stream": "^1.1.2",
|
||||
@ -6450,9 +6450,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"follow-redirects": {
|
||||
"version": "1.13.1",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz",
|
||||
"integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==",
|
||||
"version": "1.13.2",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.2.tgz",
|
||||
"integrity": "sha512-6mPTgLxYm3r6Bkkg0vNM0HTjfGrOEtsfbhagQvbxDEsEkpNhw582upBaoRZylzen6krEmxXJgt9Ju6HiI4O7BA==",
|
||||
"dev": true
|
||||
},
|
||||
"forever-agent": {
|
||||
@ -12362,26 +12362,6 @@
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"tmp": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz",
|
||||
"integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"rimraf": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"rimraf": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
|
||||
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"glob": "^7.1.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"to-buffer": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz",
|
||||
@ -13810,4 +13790,4 @@
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -71,13 +71,13 @@
|
||||
"css-loader": "^5.0.1",
|
||||
"d3": "^4.13.0",
|
||||
"debug": "^4.2.0",
|
||||
"electron": "9.4.0",
|
||||
"electron": "9.4.1",
|
||||
"electron-builder": "^22.9.1",
|
||||
"electron-mocha": "^9.3.2",
|
||||
"electron-notarize": "^1.0.0",
|
||||
"electron-rebuild": "^2.3.2",
|
||||
"electron-updater": "^4.3.5",
|
||||
"etcher-sdk": "^5.2.1",
|
||||
"etcher-sdk": "^6.1.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"husky": "^4.2.5",
|
||||
"immutable": "^3.8.1",
|
||||
@ -104,7 +104,6 @@
|
||||
"styled-components": "^5.1.0",
|
||||
"sudo-prompt": "github:zvin/sudo-prompt#7cdede2f0da28fbcc2db48402d7d935f3a825c91",
|
||||
"sys-class-rgb-led": "^3.0.0",
|
||||
"tmp": "^0.2.1",
|
||||
"ts-loader": "^8.0.12",
|
||||
"ts-node": "^9.0.0",
|
||||
"tslib": "^2.0.0",
|
||||
|
Loading…
x
Reference in New Issue
Block a user