From ddbcb883ca7562c0735ea7b493da4262fc553219 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 5 Jun 2014 16:28:28 -0700 Subject: [PATCH] Updating on mono --- src/NzbDrone.Update/UpdateApp.cs | 51 +++++++++++++++++--------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/src/NzbDrone.Update/UpdateApp.cs b/src/NzbDrone.Update/UpdateApp.cs index 9d994233f..0631f9592 100644 --- a/src/NzbDrone.Update/UpdateApp.cs +++ b/src/NzbDrone.Update/UpdateApp.cs @@ -71,30 +71,33 @@ namespace NzbDrone.Update ProcessId = ParseProcessId(args[0]) }; -// if (args.Count() == 1) -// { -// return startupContext; -// } -// -// else if (args.Count() == 3) -// { -// startupContext.UpdateLocation = args[1]; -// startupContext.ExecutingApplication = args[2]; -// } -// -// else -// { -// logger.Debug("Arguments:"); -// -// foreach (var arg in args) -// { -// logger.Debug(" {0}", arg); -// } -// -// var message = String.Format("Number of arguments are unexpected, expected: 3, found: {0}", args.Count()); -// -// throw new ArgumentOutOfRangeException("args", message); -// } + if (OsInfo.IsMono) + { + if (args.Count() == 1) + { + return startupContext; + } + + else if (args.Count() == 3) + { + startupContext.UpdateLocation = args[1]; + startupContext.ExecutingApplication = args[2]; + } + + else + { + logger.Debug("Arguments:"); + + foreach (var arg in args) + { + logger.Debug(" {0}", arg); + } + + var message = String.Format("Number of arguments are unexpected, expected: 3, found: {0}", args.Count()); + + throw new ArgumentOutOfRangeException("args", message); + } + } return startupContext; }