Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Editor/Scripts/BuildTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;

namespace CandyCoded.env.Editor
{
Expand All @@ -28,13 +29,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))
{

Expand All @@ -43,8 +37,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);
Expand Down