chore: cleanup files and split into modules

This commit is contained in:
Samuel Attard
2020-11-19 09:49:17 -08:00
parent c01deb5576
commit 0770238718
5 changed files with 186 additions and 98 deletions

15
src/asar-utils.ts Normal file
View File

@@ -0,0 +1,15 @@
import * as fs from 'fs-extra';
import * as path from 'path';
export enum AsarMode {
NO_ASAR,
HAS_ASAR,
}
export const detectAsarMode = async (appPath: string) => {
const asarPath = path.resolve(appPath, 'Contents', 'Resources', 'app.asar');
if (!(await fs.pathExists(asarPath))) return AsarMode.NO_ASAR;
return AsarMode.HAS_ASAR;
};