Skip to content

Commit c4e4bed

Browse files
committed
fix init script Fetch (if didnt have scripts/ folder)
1 parent 25fe027 commit c4e4bed

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

UnityLauncherPro/Tools.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,7 @@ public static void DownloadInitScript(string currentInitScriptFullPath, string c
691691
{
692692
// check if file exists
693693
if (File.Exists(currentInitScriptLocationOrURL) == false) return;
694+
694695
tempFile = currentInitScriptLocationOrURL;
695696
isLocalFile = true;
696697
}
@@ -705,6 +706,9 @@ public static void DownloadInitScript(string currentInitScriptFullPath, string c
705706
var tempContent = File.ReadAllText(tempFile);
706707
if (tempContent.IndexOf("public class InitializeProject") > 0 && tempContent.IndexOf("namespace UnityLauncherProTools") > 0 && tempContent.IndexOf("public static void Init()") > 0)
707708
{
709+
// create scripts folder if missing
710+
if (Directory.Exists(currentInitScriptFolder) == false) Directory.CreateDirectory(currentInitScriptFolder);
711+
708712
// move old file as backup
709713
if (File.Exists(currentInitScriptFullPath))
710714
{

0 commit comments

Comments
 (0)