Skip to content

Commit

Permalink
fix: if no enb has been selected, just copy the first one
Browse files Browse the repository at this point in the history
  • Loading branch information
MattLish committed Dec 4, 2021
1 parent 3198029 commit a86ca0a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/modOrganizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import {
userPreferences,
} from "@/main/config";
import { logger } from "@/main/logger";
import { checkENBFilesExist, copyENBFiles } from "@/main/ENB";
import { checkENBFilesExist, copyENBFiles, getENBPresets } from "@/main/ENB";
import { handleError } from "@/main/errorHandler";
import find from "find-process";
import { dialog } from "electron";
import fs from "fs";
import { parse, encode } from "ini";
import { encode, parse } from "ini";

export const MO2EXE = "ModOrganizer.exe";
const MO2Settings = "ModOrganizer.ini";
Expand Down Expand Up @@ -56,7 +56,10 @@ async function copyENBFilesOnLaunch() {
const ENBFilesExist = await checkENBFilesExist();
logger.debug(`ENB files exist on launch: ${ENBFilesExist}`);
if (!ENBFilesExist) {
await copyENBFiles(userPreferences.get(USER_PREFERENCE_KEYS.ENB_PROFILE));
const currentProfile =
(userPreferences.get(USER_PREFERENCE_KEYS.ENB_PROFILE) as string) ||
(await getENBPresets())[0];
await copyENBFiles(currentProfile);
}
}

Expand Down

0 comments on commit a86ca0a

Please sign in to comment.