Skip to content

Commit

Permalink
Program: Resolve ~ as user home (#407)
Browse files Browse the repository at this point in the history
Co-authored-by: commonuserlol <[email protected]>
  • Loading branch information
commonuserlol and commonuserlol authored Jan 10, 2025
1 parent 5a919d9 commit c0719eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Cpp2IL/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,8 @@ private static Cpp2IlRuntimeArgs GetRuntimeOptionsFromCommandLine(string[] comma

if (options.ForcedBinaryPath == null)
{
if (options.GamePath.StartsWith("~"))
options.GamePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + options.GamePath.Substring(1);
ResolvePathsFromCommandLine(options.GamePath, options.ExeName, ref result);
}
else
Expand All @@ -534,7 +536,7 @@ private static Cpp2IlRuntimeArgs GetRuntimeOptionsFromCommandLine(string[] comma
if (result.UnityVersion.Type == UnityVersionType.Alpha && result.UnityVersion.Build == 0)
//Map a0 to f1 - we assume the user simply didn't provide the final part of the version number
result.UnityVersion = new UnityVersion(result.UnityVersion.Major, result.UnityVersion.Minor, result.UnityVersion.Build, UnityVersionType.Final, 1);

result.Valid = true;
}

Expand Down

0 comments on commit c0719eb

Please sign in to comment.