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() {
return _.get(exports.getFlashResults(), ['cancelled'], false);
return _.get(getFlashResults(), ['cancelled'], false);
}
export function getLastFlashSourceChecksum(): string {
return exports.getFlashResults().sourceChecksum;
return getFlashResults().sourceChecksum;
}
export function getLastFlashErrorCode() {
return exports.getFlashResults().errorCode;
return getFlashResults().errorCode;
}
export function getFlashUuid() {

View File

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

View File

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