Skip to content

Commit

Permalink
Merge pull request #28 from VRLabs/fix/missing-folders
Browse files Browse the repository at this point in the history
Fix output folder non existing and global exception handling
  • Loading branch information
Cibbi authored Nov 1, 2023
2 parents a5bff8b + 54c3fe0 commit d777de6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 12 additions & 4 deletions VRLabs.VRCTools.Packaging.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,19 @@

command.SetHandler(async (source, output, releaseUrl, unityReleaseUrl, version, noVcc, noUnity, action) =>
{
Environment.SetEnvironmentVariable("RUNNING_ON_GITHUB_ACTIONS", action ? "true" : "false");
var result = await Packager.CreatePackage(source, output, releaseUrl, unityReleaseUrl, version, noVcc, noUnity);
if (!result)
try
{
Log.Error("Failed to create package");
Environment.SetEnvironmentVariable("RUNNING_ON_GITHUB_ACTIONS", action ? "true" : "false");
var result = await Packager.CreatePackage(source, output, releaseUrl, unityReleaseUrl, version, noVcc, noUnity);
if (!result)
{
Log.Error("Failed to create package");
Environment.Exit(1);
}
}
catch (Exception e)
{
Log.Error(e, "Failed to create package");
Environment.Exit(1);
}

Expand Down
2 changes: 2 additions & 0 deletions VRLabs.VRCTools.Packaging/Packager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public static async Task<bool> CreatePackage(string workingDirectory, string out
if(Directory.Exists(tempPath)) DeleteDirectory(tempPath);
Directory.CreateDirectory(tempPath);

if(!Directory.Exists(outputDirectory)) Directory.CreateDirectory(outputDirectory);

string? sha256String = null;
data["zipSHA256"] = null;

Expand Down

0 comments on commit d777de6

Please sign in to comment.