Skip to content

Commit

Permalink
Make parallel runs safer by using GUIDs instead of file name for extr…
Browse files Browse the repository at this point in the history
…action folder
  • Loading branch information
Miepee committed Feb 4, 2023
1 parent 4983eb7 commit 56149ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions GlennLib/RawMods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static void PortToWindows(string inputRawZipPath, string outputRawZipPath
return;
}

string extractDirectory = TempDir + "/" + Path.GetFileNameWithoutExtension(inputRawZipPath);
string extractDirectory = TempDir + "/" + Guid.NewGuid();

// Check if temp folder exists, delete if yes, extract zip to there
if (Directory.Exists(extractDirectory))
Expand Down Expand Up @@ -167,7 +167,7 @@ public static void PortToLinux(string inputRawZipPath, string outputRawZipPath,
Core.ModOS currentOS = GetModOSOfRawZip(inputRawZipPath);
outputDelegate.SendOutput("Zip Recognized as " + currentOS);

string extractDirectory = TempDir + "/" + Path.GetFileNameWithoutExtension(inputRawZipPath);
string extractDirectory = TempDir + "/" + Guid.NewGuid();
string assetsDir = extractDirectory + "/assets";

// Check if temp folder exists, delete if yes, extract zip to there
Expand Down Expand Up @@ -252,7 +252,7 @@ public static void PortToAndroid(string inputRawZipPath, string outputRawApkPath
Core.ModOS currentOS = GetModOSOfRawZip(inputRawZipPath);
outputDelegate.SendOutput("Zip Recognized as " + currentOS);

string extractDirectory = TempDir + "/" + Path.GetFileNameWithoutExtension(inputRawZipPath);
string extractDirectory = TempDir + "/" + Guid.NewGuid();
string apkDir = extractDirectory + "/apk";
string apkAssetsDir = apkDir + "/assets";
string bin = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "cmd.exe" : "java";
Expand Down Expand Up @@ -457,7 +457,7 @@ public static void PortToMac(string inputRawZipPath, string outputRawZipPath, st
Core.ModOS currentOS = GetModOSOfRawZip(inputRawZipPath);
outputDelegate.SendOutput("Zip Recognized as " + currentOS);

string baseTempDirectory = TempDir + "/" + Path.GetFileNameWithoutExtension(inputRawZipPath);
string baseTempDirectory = TempDir + "/" + Guid.NewGuid();
string extractDirectory = baseTempDirectory + "/extract";
string appDirectory = baseTempDirectory + "/AM2R.app";
string contentsDir = baseTempDirectory + "/Contents";
Expand Down

0 comments on commit 56149ca

Please sign in to comment.