mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-31 00:50:45 +01:00
Fix installation directory instance detection.
This commit is contained in:
@@ -130,7 +130,14 @@ namespace Tgstation.Server.Host.Controllers
|
||||
}, out var normalizedLocalPath);
|
||||
|
||||
if (rawPath.StartsWith(normalizedLocalPath, StringComparison.Ordinal))
|
||||
return Conflict("Instances cannot be created in the installation directory!");
|
||||
{
|
||||
bool sameLength = rawPath.Length == normalizedLocalPath.Length;
|
||||
char dirSeparatorChar = rawPath.ToCharArray()[normalizedLocalPath.Length];
|
||||
if(sameLength
|
||||
|| dirSeparatorChar == Path.DirectorySeparatorChar
|
||||
|| dirSeparatorChar == Path.AltDirectorySeparatorChar)
|
||||
return Conflict(new ErrorMessage { Message = "Instances cannot be created in the installation directory!" });
|
||||
}
|
||||
|
||||
var dirExistsTask = ioManager.DirectoryExists(model.Path, cancellationToken);
|
||||
bool attached = false;
|
||||
|
||||
Reference in New Issue
Block a user