1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-09 16:21:51 +00:00

Respect --safe-mode once again

The new mod locator system now respects the --safe-mode command line
switch, ignoring the user and distro mod directories.
This commit is contained in:
Даниїл Григор'єв 2025-04-13 01:42:06 +03:00
parent ad8e39bdf4
commit 7b4cb25d5d
No known key found for this signature in database
GPG Key ID: B890DF16341D8C1D

View File

@ -1,7 +1,7 @@
import { app } from "electron";
import fs from "node:fs/promises";
import path from "node:path";
import { executableDir, userData } from "../config.js";
import { executableDir, switches, userData } from "../config.js";
export const MOD_FILE_SUFFIX = ".asar";
@ -51,6 +51,10 @@ abstract class DirectoryModLocator implements ModLocator {
}
async locateMods(): Promise<string[]> {
if (switches.safeMode) {
return [];
}
try {
const dir = await fs.readdir(this.directory, { withFileTypes: true });
return dir