Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit d16d17c

Browse files
committed
Make some files not required
1 parent 9bae318 commit d16d17c

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/UnityDevelopmentBuildMaker/Maker.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ public class Maker
1010

1111
private readonly MakerConfig _config;
1212

13-
private static readonly string[] _filesToReplace = new[]
13+
private static readonly (string Name, bool IsRequired)[] _filesToReplace = new[]
1414
{
15-
"UnityPlayer.dll",
16-
"WinPixEventRuntime.dll",
15+
( "UnityPlayer.dll", true ),
16+
( "WinPixEventRuntime.dll", false ),
1717
};
1818

1919
private static readonly string[] _directoriesToReplace = new[]
@@ -85,12 +85,17 @@ private void Copy()
8585

8686
foreach (var file in _filesToReplace)
8787
{
88-
var fromPath = Path.Combine(fromDirectory, file);
89-
var toPath = Path.Combine(toDirectory, file);
88+
var fromPath = Path.Combine(fromDirectory, file.Name);
89+
var toPath = Path.Combine(toDirectory, file.Name);
90+
91+
if (!file.IsRequired && !File.Exists(fromPath))
92+
{
93+
continue;
94+
}
9095

9196
if (File.Exists(toPath))
9297
{
93-
File.Move(toPath, Path.Combine(backupDirectory, file));
98+
File.Move(toPath, Path.Combine(backupDirectory, file.Name));
9499
}
95100

96101
File.Copy(fromPath, toPath);

0 commit comments

Comments
 (0)