mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-28 05:36:34 +00:00
Centralize imports in child-writer
Changelog-entry: Centralize imports in child-writer Change-type: patch
This commit is contained in:
parent
3218fc2c83
commit
963fc574c3
@ -21,7 +21,6 @@ import { cleanupTmpFiles } from 'etcher-sdk/build/tmp';
|
|||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
import * as ipc from 'node-ipc';
|
import * as ipc from 'node-ipc';
|
||||||
|
|
||||||
import { File, Http } from 'etcher-sdk/build/source-destination';
|
|
||||||
import { toJSON } from '../../shared/errors';
|
import { toJSON } from '../../shared/errors';
|
||||||
import { GENERAL_ERROR, SUCCESS } from '../../shared/exit-codes';
|
import { GENERAL_ERROR, SUCCESS } from '../../shared/exit-codes';
|
||||||
import { SourceOptions } from '../app/components/source-selector/source-selector';
|
import { SourceOptions } from '../app/components/source-selector/source-selector';
|
||||||
@ -241,12 +240,15 @@ ipc.connectTo(IPC_SERVER_ID, () => {
|
|||||||
});
|
});
|
||||||
const { SourceType } = options;
|
const { SourceType } = options;
|
||||||
let source;
|
let source;
|
||||||
if (SourceType === File.name) {
|
if (SourceType === sdk.sourceDestination.File.name) {
|
||||||
source = new File({
|
source = new sdk.sourceDestination.File({
|
||||||
path: options.imagePath,
|
path: options.imagePath,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
source = new Http({ url: options.imagePath, avoidRandomAccess: true });
|
source = new sdk.sourceDestination.Http({
|
||||||
|
url: options.imagePath,
|
||||||
|
avoidRandomAccess: true,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const results = await writeAndValidate({
|
const results = await writeAndValidate({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user