Skip to content

Commit c0719eb

Browse files
Program: Resolve ~ as user home (#407)
Co-authored-by: commonuserlol <[email protected]>
1 parent 5a919d9 commit c0719eb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Cpp2IL/Program.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,8 @@ private static Cpp2IlRuntimeArgs GetRuntimeOptionsFromCommandLine(string[] comma
522522

523523
if (options.ForcedBinaryPath == null)
524524
{
525+
if (options.GamePath.StartsWith("~"))
526+
options.GamePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + options.GamePath.Substring(1);
525527
ResolvePathsFromCommandLine(options.GamePath, options.ExeName, ref result);
526528
}
527529
else
@@ -534,7 +536,7 @@ private static Cpp2IlRuntimeArgs GetRuntimeOptionsFromCommandLine(string[] comma
534536
if (result.UnityVersion.Type == UnityVersionType.Alpha && result.UnityVersion.Build == 0)
535537
//Map a0 to f1 - we assume the user simply didn't provide the final part of the version number
536538
result.UnityVersion = new UnityVersion(result.UnityVersion.Major, result.UnityVersion.Minor, result.UnityVersion.Build, UnityVersionType.Final, 1);
537-
539+
538540
result.Valid = true;
539541
}
540542

0 commit comments

Comments
 (0)