mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-09-12 05:07:06 +00:00
Fixed a MacOS-specific issue
This commit is contained in:
parent
ffd0a98393
commit
15ffbf2fe7
|
@ -1,5 +1,7 @@
|
||||||
package funkin.util;
|
package funkin.util;
|
||||||
|
|
||||||
|
import haxe.io.Path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utilties for interpreting command line arguments.
|
* Utilties for interpreting command line arguments.
|
||||||
*/
|
*/
|
||||||
|
@ -13,9 +15,20 @@ class CLIUtil
|
||||||
public static function resetWorkingDir():Void
|
public static function resetWorkingDir():Void
|
||||||
{
|
{
|
||||||
#if sys
|
#if sys
|
||||||
var exeDir:String = haxe.io.Path.directory(Sys.programPath());
|
var exeDir:String = Path.addTrailingSlash(Path.directory(Sys.programPath()));
|
||||||
trace('Changing working directory from ${Sys.getCwd()} to ${exeDir}');
|
#if mac
|
||||||
Sys.setCwd(exeDir);
|
exeDir = Path.addTrailingSlash(Path.join([exeDir, '../Resources/']));
|
||||||
|
#end
|
||||||
|
var cwd:String = Path.addTrailingSlash(Sys.getCwd());
|
||||||
|
if (cwd == exeDir)
|
||||||
|
{
|
||||||
|
trace('Working directory is already correct.');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
trace('Changing working directory from ${Sys.getCwd()} to ${exeDir}');
|
||||||
|
Sys.setCwd(exeDir);
|
||||||
|
}
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue