Browse Source

allow explicit path for local storage directory

Nicolas Cannasse 1 year ago
parent
commit
c00eff2039
1 changed files with 2 additions and 2 deletions
  1. 2 2
      hxd/fs/LocalFileSystem.hx

+ 2 - 2
hxd/fs/LocalFileSystem.hx

@@ -245,7 +245,7 @@ class LocalFileSystem implements FileSystem {
 	static var isWindows = Sys.systemName() == "Windows";
 	static var isWindows = Sys.systemName() == "Windows";
 	public static var FILES_CHECK_MAX = 5;
 	public static var FILES_CHECK_MAX = 5;
 
 
-	public function new( dir : String, configuration : String ) {
+	public function new( dir : String, configuration : String, ?storagePath ) {
 		baseDir = dir;
 		baseDir = dir;
 		if( configuration == null )
 		if( configuration == null )
 			configuration = "default";
 			configuration = "default";
@@ -253,7 +253,7 @@ class LocalFileSystem implements FileSystem {
 		#if macro
 		#if macro
 		var exePath = null;
 		var exePath = null;
 		#else
 		#else
-		var pr = Sys.programPath();
+		var pr = storagePath != null ? storagePath : Sys.programPath();
 		var exePath = pr == null ? null : pr.split("\\").join("/").split("/");
 		var exePath = pr == null ? null : pr.split("\\").join("/").split("/");
 		#end
 		#end