diff --git a/RevolutionaryGamesCommon b/RevolutionaryGamesCommon index 7202ddce..b32d9a7d 160000 --- a/RevolutionaryGamesCommon +++ b/RevolutionaryGamesCommon @@ -1 +1 @@ -Subproject commit 7202ddce6a54756ae900422e7c933b76498b82a6 +Subproject commit b32d9a7d76528707fbae8ff3afa37331035d3c37 diff --git a/Scripts/SourceTool.cs b/Scripts/SourceTool.cs index 09bb60eb..c34ed37a 100644 --- a/Scripts/SourceTool.cs +++ b/Scripts/SourceTool.cs @@ -36,6 +36,30 @@ await GitRunHelpers.Archive(submodule, "HEAD", moduleTar, $"Thrive-Launcher/{sub await Compression.CombineTar(targetArchiveName, moduleTar, cancellationToken); } + // Include git info + ColourConsole.WriteNormalLine("Making a clean copy of the repo to include git info in source"); + var cleanGitFolder = "clean-git"; + + if (Directory.Exists(cleanGitFolder)) + Directory.Delete(cleanGitFolder, true); + + await GitRunHelpers.CloneLocalRepo(".", cleanGitFolder, cancellationToken); + + // Fudge the directory structure to be correct for adding to the tar + var fudgedPath = Path.Join(cleanGitFolder, "Thrive-Launcher"); + + if (Directory.Exists(fudgedPath)) + Directory.Delete(fudgedPath, true); + + Directory.CreateDirectory(fudgedPath); + + Directory.Move(Path.Join(cleanGitFolder, ".git"), Path.Join(fudgedPath, ".git")); + + await Compression.AddFilesToTar(targetArchiveName, cleanGitFolder, new[] { "Thrive-Launcher" }, + cancellationToken); + + Directory.Delete(cleanGitFolder, true); + ColourConsole.WriteNormalLine("Compressing source archive with xz"); await Compression.XzCompressFile(targetArchiveName, cancellationToken, 9);