Skip to content

Commit

Permalink
Update main.csx
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas authored Aug 7, 2022
1 parent 033f889 commit 4476ec3
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions source-diff/main.csx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ using CliWrap;
var binDirectory = Path.Combine("bin", "Win64_Shipping_Client");
var modulesDirectory = "Modules";

var oldSrc = "old_src";
var newSrc = "new_src";
var oldSrc = "old";
var newSrc = "new";

var oldPath = "old";
var newPath = "new";
var oldPath = "old_dll";
var newPath = "new_dll";

var oldBinPath = Path.Combine(oldPath, binDirectory);
var newBinPath = Path.Combine(newPath, binDirectory);
Expand Down Expand Up @@ -122,7 +122,7 @@ static async Task DecompileFile(string filter, string binPath, string referenceP
File.Delete(csproj);
}

foreach (var cs in Directory.GetFiles(outputPath, "*.cs"))
foreach (var cs in Directory.GetFiles(outputPath, "*.cs", SearchOption.AllDirectories))
{
var content = File.ReadAllText(cs);
var idx = content.IndexOf("namespace", StringComparison.Ordinal);
Expand Down Expand Up @@ -150,16 +150,16 @@ static async Task DiffDirectories(string oldSrc, string newSrc, string outputPat

Console.WriteLine($"Diffing {directory}");
var cmd =
Cli.Wrap("diff")
.WithArguments($"-ur {oldPath} {newPath}")
Cli.Wrap("git")
.WithArguments($"diff --no-index -u --relative -M30% {oldPath} {newPath}")
.WithValidation(CommandResultValidation.None)
|
Cli.Wrap("sed")
.WithArguments(@"-e 's/a\/old\///g' -e 's/a\/new\///g' -e 's/b\/old\///g' -e 's/b\/new\///g'")
.WithValidation(CommandResultValidation.None)
|
Cli.Wrap("diff2html")
.WithArguments($"--no-index -u --relative -M30% -i stdin -F {Path.Combine(outputPath, $"{directoryName}.html")}")
.WithArguments($"-i stdin -F {Path.Combine(outputPath, $"{directoryName}.html")}")
.WithValidation(CommandResultValidation.None);
await cmd.ExecuteAsync();
}
Expand All @@ -177,16 +177,16 @@ static async Task DiffDirectories(string oldSrc, string newSrc, string outputPat

Console.WriteLine($"Diffing {directory}");
var cmd =
Cli.Wrap("diff")
.WithArguments($"-ur {oldPath} {newPath}")
Cli.Wrap("git")
.WithArguments($"diff --no-index -u --relative -M30% {oldPath} {newPath}")
.WithValidation(CommandResultValidation.None)
|
Cli.Wrap("sed")
.WithArguments(@"-e 's/a\/old\///g' -e 's/a\/new\///g' -e 's/b\/old\///g' -e 's/b\/new\///g'")
.WithValidation(CommandResultValidation.None)
|
Cli.Wrap("diff2html")
.WithArguments($"--no-index -u --relative -M30% -i stdin -F {Path.Combine(outputPath, $"{directoryName}.html")}")
.WithArguments($"-i stdin -F {Path.Combine(outputPath, $"{directoryName}.html")}")
.WithValidation(CommandResultValidation.None);
await cmd.ExecuteAsync();
}
Expand Down

0 comments on commit 4476ec3

Please sign in to comment.