Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit f9585c6

Browse files
authored
Fix MacOSX Symlink issues with code generator (#1042)
1 parent ca92bb5 commit f9585c6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

workers/unity/Packages/io.improbable.gdk.tools/GenerateCode.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,25 @@ private static void Generate()
8282
var projectPath = Path.GetFullPath(Path.Combine(Common.GetThisPackagePath(),
8383
CsProjectFile));
8484

85+
86+
// Fix up symlinking for Mac
87+
if (Application.platform == RuntimePlatform.OSXEditor)
88+
{
89+
var packageAttributes = File.GetAttributes(Common.GetThisPackagePath());
90+
if (packageAttributes.HasFlag(FileAttributes.ReparsePoint))
91+
{
92+
var process = RedirectedProcess.Command("pwd")
93+
.WithArgs("-P")
94+
.InDirectory(Common.GetThisPackagePath())
95+
.RedirectOutputOptions(OutputRedirectBehaviour.None);
96+
97+
var result = process.RunAsync().Result;
98+
var realPath = string.Join("\n", result.Stdout).Trim();
99+
100+
projectPath = Path.GetFullPath(Path.Combine(realPath, CsProjectFile));
101+
}
102+
}
103+
85104
var schemaCompilerPath = SchemaCompilerPath;
86105

87106
var workerJsonPath =

0 commit comments

Comments
 (0)