From 963fc574c3569127da7cfce75642e50d5b226c3e Mon Sep 17 00:00:00 2001 From: Alexis Svinartchouk Date: Thu, 16 Jul 2020 13:05:53 +0200 Subject: [PATCH] Centralize imports in child-writer Changelog-entry: Centralize imports in child-writer Change-type: patch --- lib/gui/modules/child-writer.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/gui/modules/child-writer.ts b/lib/gui/modules/child-writer.ts index 7b14bf3b..e7e3e78e 100644 --- a/lib/gui/modules/child-writer.ts +++ b/lib/gui/modules/child-writer.ts @@ -21,7 +21,6 @@ import { cleanupTmpFiles } from 'etcher-sdk/build/tmp'; import * as _ from 'lodash'; import * as ipc from 'node-ipc'; -import { File, Http } from 'etcher-sdk/build/source-destination'; import { toJSON } from '../../shared/errors'; import { GENERAL_ERROR, SUCCESS } from '../../shared/exit-codes'; import { SourceOptions } from '../app/components/source-selector/source-selector'; @@ -241,12 +240,15 @@ ipc.connectTo(IPC_SERVER_ID, () => { }); const { SourceType } = options; let source; - if (SourceType === File.name) { - source = new File({ + if (SourceType === sdk.sourceDestination.File.name) { + source = new sdk.sourceDestination.File({ path: options.imagePath, }); } else { - source = new Http({ url: options.imagePath, avoidRandomAccess: true }); + source = new sdk.sourceDestination.Http({ + url: options.imagePath, + avoidRandomAccess: true, + }); } try { const results = await writeAndValidate({