Check wrong .dme before .dme exists

This commit is contained in:
Jordan Dominion
2024-07-26 17:04:22 -04:00
parent 6559088ff1
commit 3acd25e6d4
@@ -607,12 +607,12 @@ namespace Tgstation.Server.Host.Components.Deployment
else
{
var targetDme = ioManager.ConcatPath(outputDirectory, String.Join('.', job.DmeName, DmeExtension));
if (!await ioManager.PathIsChildOf(outputDirectory, targetDme, cancellationToken))
throw new JobException(ErrorCode.DeploymentWrongDme);
var targetDmeExists = await ioManager.FileExists(targetDme, cancellationToken);
if (!targetDmeExists)
throw new JobException(ErrorCode.DeploymentMissingDme);
if (!await ioManager.PathIsChildOf(outputDirectory, targetDme, cancellationToken))
throw new JobException(ErrorCode.DeploymentWrongDme);
}
logger.LogDebug("Selected \"{dmeName}.dme\" for compilation!", job.DmeName);