Skip to content

Commit

Permalink
Merge pull request #3414 from balena-io/116
Browse files Browse the repository at this point in the history
116
  • Loading branch information
bulldozer-balena[bot] authored Feb 3, 2021
2 parents 9f52dda + 48b5e8b commit 0f70c4b
Show file tree
Hide file tree
Showing 9 changed files with 10,439 additions and 89 deletions.
10,415 changes: 10,415 additions & 0 deletions .versionbot/CHANGELOG.yml

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions lib/gui/app/components/drive-selector/drive-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'] {
Expand Down
16 changes: 0 additions & 16 deletions lib/gui/app/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
7 changes: 3 additions & 4 deletions lib/gui/app/os/windows-network-drives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
*/

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';
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);
Expand All @@ -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',
Expand Down
3 changes: 2 additions & 1 deletion lib/gui/modules/child-writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
});
Expand Down
5 changes: 3 additions & 2 deletions lib/shared/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
27 changes: 0 additions & 27 deletions lib/shared/tmp.ts

This file was deleted.

48 changes: 14 additions & 34 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 0f70c4b

Please sign in to comment.