fix: add debug logging

This commit is contained in:
Samuel Attard
2020-11-19 10:01:20 -08:00
parent 0770238718
commit 621083fe1f
6 changed files with 71 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
import * as fs from 'fs-extra';
import * as path from 'path';
import { d } from './debug';
export enum AsarMode {
NO_ASAR,
@@ -7,9 +8,14 @@ export enum AsarMode {
}
export const detectAsarMode = async (appPath: string) => {
d('checking asar mode of', appPath);
const asarPath = path.resolve(appPath, 'Contents', 'Resources', 'app.asar');
if (!(await fs.pathExists(asarPath))) return AsarMode.NO_ASAR;
if (!(await fs.pathExists(asarPath))) {
d('determined no asar');
return AsarMode.NO_ASAR;
}
d('determined has asar');
return AsarMode.HAS_ASAR;
};