mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-20 21:54:25 -04:00
New: Command line arguments for Custom Scripts are no longer supported
This commit is contained in:
@@ -108,11 +108,7 @@ namespace NzbDrone.Common.Processes
|
||||
|
||||
public Process Start(string path, string args = null, StringDictionary environmentVariables = null, Action<string> onOutputDataReceived = null, Action<string> onErrorDataReceived = null)
|
||||
{
|
||||
if (PlatformInfo.IsMono && path.EndsWith(".exe", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
args = GetMonoArgs(path, args);
|
||||
path = "mono";
|
||||
}
|
||||
(path, args) = GetPathAndArgs(path, args);
|
||||
|
||||
var logger = LogManager.GetLogger(new FileInfo(path).Name);
|
||||
|
||||
@@ -192,11 +188,7 @@ namespace NzbDrone.Common.Processes
|
||||
|
||||
public Process SpawnNewProcess(string path, string args = null, StringDictionary environmentVariables = null, bool noWindow = false)
|
||||
{
|
||||
if (PlatformInfo.IsMono && path.EndsWith(".exe", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
args = GetMonoArgs(path, args);
|
||||
path = "mono";
|
||||
}
|
||||
(path, args) = GetPathAndArgs(path, args);
|
||||
|
||||
_logger.Debug("Starting {0} {1}", path, args);
|
||||
|
||||
@@ -361,9 +353,19 @@ namespace NzbDrone.Common.Processes
|
||||
return processes;
|
||||
}
|
||||
|
||||
private string GetMonoArgs(string path, string args)
|
||||
private (string Path, string Args) GetPathAndArgs(string path, string args)
|
||||
{
|
||||
return string.Format("--debug {0} {1}", path, args);
|
||||
if (PlatformInfo.IsMono && path.EndsWith(".exe", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
return ("mono", $"--debug {path} {args}");
|
||||
}
|
||||
|
||||
if (OsInfo.IsWindows && path.EndsWith(".bat", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
return ("cmd.exe", $"/c {path} {args}");
|
||||
}
|
||||
|
||||
return (path, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user