This commit is contained in:
Master Kwoth 2017-10-28 14:20:08 +02:00
parent e25ded9e24
commit 58d0635658
3 changed files with 16 additions and 11 deletions

View File

@ -3,13 +3,6 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework> <TargetFramework>netcoreapp2.0</TargetFramework>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>

View File

@ -76,10 +76,20 @@ namespace NadekoBot.Core.Services.Impl
if (!string.IsNullOrWhiteSpace(cmd)) if (!string.IsNullOrWhiteSpace(cmd))
RestartCommand = new RestartConfig(cmd, args); RestartCommand = new RestartConfig(cmd, args);
if (string.IsNullOrWhiteSpace(ShardRunCommand)) if (Environment.OSVersion.Platform == PlatformID.Unix)
ShardRunCommand = "dotnet"; {
if (string.IsNullOrWhiteSpace(ShardRunArguments)) if (string.IsNullOrWhiteSpace(ShardRunCommand))
ShardRunArguments = "run -c Release -- {0} {1}"; ShardRunCommand = "dotnet";
if (string.IsNullOrWhiteSpace(ShardRunArguments))
ShardRunArguments = "run -c Release -- {0} {1}";
}
else //windows
{
if (string.IsNullOrWhiteSpace(ShardRunCommand))
ShardRunCommand = "NadekoBot.exe";
if (string.IsNullOrWhiteSpace(ShardRunArguments))
ShardRunArguments = "{0} {1}";
}
var portStr = data[nameof(ShardRunPort)]; var portStr = data[nameof(ShardRunPort)];
if (string.IsNullOrWhiteSpace(portStr)) if (string.IsNullOrWhiteSpace(portStr))

View File

@ -293,6 +293,8 @@ namespace NadekoBot.Core.Services
private Process StartShard(int shardId) private Process StartShard(int shardId)
{ {
Console.WriteLine(_creds.ShardRunCommand);
Console.WriteLine(_creds.ShardRunArguments);
return Process.Start(new ProcessStartInfo() return Process.Start(new ProcessStartInfo()
{ {
FileName = _creds.ShardRunCommand, FileName = _creds.ShardRunCommand,