Remove useless export.

Change-type: patch
This commit is contained in:
Alexis Svinartchouk 2020-01-15 17:19:59 +01:00
parent 2eda6601c0
commit d633b36b23
3 changed files with 19 additions and 21 deletions

View File

@ -115,15 +115,15 @@ export function getFlashState() {
} }
export function wasLastFlashCancelled() { export function wasLastFlashCancelled() {
return _.get(exports.getFlashResults(), ['cancelled'], false); return _.get(getFlashResults(), ['cancelled'], false);
} }
export function getLastFlashSourceChecksum(): string { export function getLastFlashSourceChecksum(): string {
return exports.getFlashResults().sourceChecksum; return getFlashResults().sourceChecksum;
} }
export function getLastFlashErrorCode() { export function getLastFlashErrorCode() {
return exports.getFlashResults().errorCode; return getFlashResults().errorCode;
} }
export function getFlashUuid() { export function getFlashUuid() {

View File

@ -175,47 +175,47 @@ export function getDriveImageCompatibilityStatuses(
const statusList = []; const statusList = [];
// Mind the order of the if-statements if you modify. // Mind the order of the if-statements if you modify.
if (exports.isSourceDrive(drive, image)) { if (isSourceDrive(drive, image)) {
statusList.push({ statusList.push({
type: exports.COMPATIBILITY_STATUS_TYPES.ERROR, type: COMPATIBILITY_STATUS_TYPES.ERROR,
message: messages.compatibility.containsImage(), message: messages.compatibility.containsImage(),
}); });
} else if (exports.isDriveLocked(drive)) { } else if (isDriveLocked(drive)) {
statusList.push({ statusList.push({
type: exports.COMPATIBILITY_STATUS_TYPES.ERROR, type: COMPATIBILITY_STATUS_TYPES.ERROR,
message: messages.compatibility.locked(), message: messages.compatibility.locked(),
}); });
} else if ( } else if (
!_.isNil(drive) && !_.isNil(drive) &&
!_.isNil(drive.size) && !_.isNil(drive.size) &&
!exports.isDriveLargeEnough(drive, image) !isDriveLargeEnough(drive, image)
) { ) {
const imageSize = (image.isSizeEstimated const imageSize = (image.isSizeEstimated
? image.compressedSize ? image.compressedSize
: image.size) as number; : image.size) as number;
const relativeBytes = imageSize - drive.size; const relativeBytes = imageSize - drive.size;
statusList.push({ statusList.push({
type: exports.COMPATIBILITY_STATUS_TYPES.ERROR, type: COMPATIBILITY_STATUS_TYPES.ERROR,
message: messages.compatibility.tooSmall(prettyBytes(relativeBytes)), message: messages.compatibility.tooSmall(prettyBytes(relativeBytes)),
}); });
} else { } else {
if (exports.isSystemDrive(drive)) { if (isSystemDrive(drive)) {
statusList.push({ statusList.push({
type: exports.COMPATIBILITY_STATUS_TYPES.WARNING, type: COMPATIBILITY_STATUS_TYPES.WARNING,
message: messages.compatibility.system(), message: messages.compatibility.system(),
}); });
} }
if (exports.isDriveSizeLarge(drive)) { if (isDriveSizeLarge(drive)) {
statusList.push({ statusList.push({
type: exports.COMPATIBILITY_STATUS_TYPES.WARNING, type: COMPATIBILITY_STATUS_TYPES.WARNING,
message: messages.compatibility.largeDrive(), message: messages.compatibility.largeDrive(),
}); });
} }
if (!_.isNil(drive) && !exports.isDriveSizeRecommended(drive, image)) { if (!_.isNil(drive) && !isDriveSizeRecommended(drive, image)) {
statusList.push({ statusList.push({
type: exports.COMPATIBILITY_STATUS_TYPES.WARNING, type: COMPATIBILITY_STATUS_TYPES.WARNING,
message: messages.compatibility.sizeNotRecommended(), message: messages.compatibility.sizeNotRecommended(),
}); });
} }
@ -274,7 +274,5 @@ export function hasListDriveImageCompatibilityStatus(
drives: DrivelistDrive[], drives: DrivelistDrive[],
image: Image, image: Image,
) { ) {
return Boolean( return Boolean(getListDriveImageCompatibilityStatuses(drives, image).length);
exports.getListDriveImageCompatibilityStatuses(drives, image).length,
);
} }

View File

@ -88,7 +88,7 @@ function setEnvVarCmd(value: any, name: string): string {
export function createLaunchScript( export function createLaunchScript(
command: string, command: string,
argv: string[], argv: string[],
environment: _.Dictionary<string>, environment: _.Dictionary<string | undefined>,
): string { ): string {
const isWindows = os.platform() === 'win32'; const isWindows = os.platform() === 'win32';
const lines = []; const lines = [];
@ -148,14 +148,14 @@ export async function elevateCommand(
applicationName: string; applicationName: string;
}, },
): Promise<{ cancelled: boolean }> { ): Promise<{ cancelled: boolean }> {
if (await exports.isElevated()) { if (await isElevated()) {
await execFileAsync(command[0], command.slice(1), { await execFileAsync(command[0], command.slice(1), {
env: options.environment, env: options.environment,
}); });
return { cancelled: false }; return { cancelled: false };
} }
const isWindows = os.platform() === 'win32'; const isWindows = os.platform() === 'win32';
const launchScript = exports.createLaunchScript( const launchScript = createLaunchScript(
command[0], command[0],
command.slice(1), command.slice(1),
options.environment, options.environment,