aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Mono/Program.cs
diff options
context:
space:
mode:
authortikuf <admin@nyalindee.com>2014-04-16 10:14:20 +1000
committertikuf <admin@nyalindee.com>2014-04-16 10:14:20 +1000
commit13196544c2ca525068e34d23bd98da551943bbca (patch)
treead9894c55a3f3078c15b7622f424b950524b4e2b /MediaBrowser.Server.Mono/Program.cs
parentf9eede391b2de2ce80e75d8345aade14f70f1b9d (diff)
parentab5f8ed13679dbe1763cafc599a8f566a36a4a14 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Server.Mono/Program.cs')
-rw-r--r--MediaBrowser.Server.Mono/Program.cs17
1 files changed, 14 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Mono/Program.cs b/MediaBrowser.Server.Mono/Program.cs
index 0f2a90900..e1d3cda40 100644
--- a/MediaBrowser.Server.Mono/Program.cs
+++ b/MediaBrowser.Server.Mono/Program.cs
@@ -16,6 +16,7 @@ using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using System.Reflection;
+using System.Linq;
// MONOMKBUNDLE: For the embedded version, mkbundle tool
#if MONOMKBUNDLE
using Mono.Unix;
@@ -39,8 +40,13 @@ namespace MediaBrowser.Server.Mono
#else
var applicationPath = Assembly.GetEntryAssembly ().Location;
#endif
+
+ var commandArgs = Environment.GetCommandLineArgs();
+
+ // Allow this to be specified on the command line.
+ var customProgramDataPath = commandArgs.ElementAtOrDefault(1);
- var appPaths = CreateApplicationPaths(applicationPath);
+ var appPaths = CreateApplicationPaths(applicationPath, customProgramDataPath);
var logManager = new NlogManager(appPaths.LogDirectoryPath, "server");
logManager.ReloadLogger(LogSeverity.Info);
@@ -70,9 +76,14 @@ namespace MediaBrowser.Server.Mono
}
}
- private static ServerApplicationPaths CreateApplicationPaths(string applicationPath)
+ private static ServerApplicationPaths CreateApplicationPaths(string applicationPath, string programDataPath)
{
- return new ServerApplicationPaths(applicationPath);
+ if (string.IsNullOrEmpty(programDataPath))
+ {
+ return new ServerApplicationPaths(applicationPath);
+ }
+
+ return new ServerApplicationPaths(programDataPath, applicationPath);
}
/// <summary>