working directory fix
This commit is contained in:
@@ -19,6 +19,7 @@ class CommandLineHandler {
|
||||
#end
|
||||
Sys.println("-nocolor | Disables colors in the terminal");
|
||||
Sys.println("-nogpubitmap | Forces GPU only bitmaps off");
|
||||
Sys.println("-nocwdfix | Turns off automatic working directory fix");
|
||||
Sys.exit(0);
|
||||
#if MOD_SUPPORT
|
||||
case "-m" | "-mod" | "-currentmod":
|
||||
@@ -59,6 +60,8 @@ class CommandLineHandler {
|
||||
Main.noTerminalColor = true;
|
||||
case "-nogpubitmap":
|
||||
Main.forceGPUOnlyBitmapsOff = true;
|
||||
case "-nocwdfix":
|
||||
Main.noCwdFix = true;
|
||||
case "-livereload":
|
||||
// do nothing
|
||||
default:
|
||||
|
||||
@@ -204,4 +204,13 @@ class Main extends Sprite
|
||||
|
||||
MemoryUtil.clearMajor();
|
||||
}
|
||||
|
||||
public static var noCwdFix:Bool = false;
|
||||
public static function fixWorkingDirectory() {
|
||||
#if windows
|
||||
if (!noCwdFix && !sys.FileSystem.exists('manifest/default.json')) {
|
||||
Sys.setCwd(haxe.io.Path.directory(Sys.programPath()));
|
||||
}
|
||||
#end
|
||||
}
|
||||
}
|
||||
|
||||
@@ -536,6 +536,7 @@ class System
|
||||
#if (sys && !macro)
|
||||
funkin.backend.utils.NativeAPI.registerAsDPICompatible();
|
||||
funkin.backend.system.CommandLineHandler.parseCommandLine(Sys.args());
|
||||
funkin.backend.system.Main.fixWorkingDirectory();
|
||||
#end
|
||||
|
||||
if (__applicationEntryPoint == null)
|
||||
|
||||
Reference in New Issue
Block a user