Skip to content

Commit

Permalink
Make script paths always use / as the path seperator to be cross-comp…
Browse files Browse the repository at this point in the history
…atible
  • Loading branch information
LukeFZ committed Jul 15, 2024
1 parent 85154de commit b4aaa8d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Il2CppInspector.Common/Outputs/PythonScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ public void WriteScriptToFile(string outputFile, string target, string existingT
private void writeJsonMetadata(string jsonMetadataFile) => new JSONMetadata(model).Write(jsonMetadataFile);

private string getRelativePath(string from, string to) =>
Path.GetRelativePath(Path.GetDirectoryName(Path.GetFullPath(from)),
Path.GetDirectoryName(Path.GetFullPath(to)))
+ Path.DirectorySeparatorChar
Path.GetRelativePath(Path.GetDirectoryName(Path.GetFullPath(from))!,
Path.GetDirectoryName(Path.GetFullPath(to))!)
+ '/'
// We do not use Path.DirectorySeparatorChar here as scripts might be generated on windows then ran on linux,
// and / is cross-compatible
+ Path.GetFileName(to);
}
}

0 comments on commit b4aaa8d

Please sign in to comment.