diff --git a/lib/utils/visuals/drive-list.ts b/lib/utils/visuals/drive-list.ts index ac76d6cb..b63341f7 100644 --- a/lib/utils/visuals/drive-list.ts +++ b/lib/utils/visuals/drive-list.ts @@ -1,12 +1,12 @@ import chalk from 'chalk'; -import * as sdk from 'etcher-sdk'; +import * as _sdk from 'etcher-sdk'; import { CustomDynamicList } from './custom-dynamic-list'; export class DriveList extends CustomDynamicList< - sdk.sourceDestination.BlockDevice + _sdk.sourceDestination.BlockDevice > { - constructor(private scanner: sdk.scanner.Scanner) { + constructor(private scanner: _sdk.scanner.Scanner) { super( 'Select a drive', `${chalk.red('x')} No available drives were detected, plug one in!`, @@ -17,6 +17,7 @@ export class DriveList extends CustomDynamicList< } protected *getThings() { + const sdk: typeof _sdk = require('etcher-sdk') for (const drive of this.scanner.drives) { if (drive instanceof sdk.sourceDestination.BlockDevice) { yield drive; @@ -24,7 +25,7 @@ export class DriveList extends CustomDynamicList< } } - protected format(drive: sdk.sourceDestination.BlockDevice) { + protected format(drive: _sdk.sourceDestination.BlockDevice) { const size = drive.size / 1e9; return `${drive.device} (${size.toFixed(1)} GB) - ${drive.description}`; }