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:
parent
ad8e39bdf4
commit
7b4cb25d5d
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user