1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

use mono to start process if in linux.

This commit is contained in:
kay.one 2013-08-13 21:25:38 -07:00
parent 836a79a9cc
commit 735cdfe5d6

View File

@ -4,6 +4,7 @@
using System.IO;
using System.Linq;
using NLog;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Model;
namespace NzbDrone.Common
@ -82,6 +83,13 @@ public Process Start(string path)
public Process ShellExecute(string path, string args = null, Action<string> onOutputDataReceived = null, Action<string> onErrorDataReceived = null)
{
if (OsInfo.IsMono && path.EndsWith(".exe", StringComparison.InvariantCultureIgnoreCase))
{
args = path + " " + args;
path = "mono";
}
var logger = LogManager.GetLogger(new FileInfo(path).Name);
var startInfo = new ProcessStartInfo(path, args)