From 478d1d3b2bca57e4193dfaaead4e72070040fad7 Mon Sep 17 00:00:00 2001 From: Sam Mateosian Date: Tue, 5 Mar 2024 14:21:18 -0800 Subject: [PATCH 1/2] throw a warning rather than an exception for existing runtime env.txt fike --- Editor/Scripts/BuildTools.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Editor/Scripts/BuildTools.cs b/Editor/Scripts/BuildTools.cs index 618fa84..b17f382 100644 --- a/Editor/Scripts/BuildTools.cs +++ b/Editor/Scripts/BuildTools.cs @@ -28,13 +28,6 @@ public void OnPostprocessBuild(BuildReport report) public void OnPreprocessBuild(BuildReport report) { - if (File.Exists(env.runtimeFilePath)) - { - - throw new Exception($"{env.runtimeFilePath} already exists. Remove this file before continuing."); - - } - if (!Directory.Exists(env.resourcesDirPath)) { @@ -43,8 +36,14 @@ public void OnPreprocessBuild(BuildReport report) _resourcesDirCreated = true; } - - if (File.Exists(env.editorFilePath)) + + if (File.Exists(env.runtimeFilePath)) + { + + Debug.LogWarning($"{env.runtimeFilePath} already exists, using the existing file rather than copying current env."); + + } + else if (File.Exists(env.editorFilePath)) { FileUtil.CopyFileOrDirectory(env.editorFilePath, env.runtimeFilePath); From 986fd9326607c5810f2e940a488abd4c0225bed8 Mon Sep 17 00:00:00 2001 From: Sam Mateosian Date: Tue, 5 Mar 2024 14:34:39 -0800 Subject: [PATCH 2/2] needs UnityEngine to access Debug --- Editor/Scripts/BuildTools.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Editor/Scripts/BuildTools.cs b/Editor/Scripts/BuildTools.cs index b17f382..a8807e2 100644 --- a/Editor/Scripts/BuildTools.cs +++ b/Editor/Scripts/BuildTools.cs @@ -5,6 +5,7 @@ using UnityEditor; using UnityEditor.Build; using UnityEditor.Build.Reporting; +using UnityEngine; namespace CandyCoded.env.Editor {