Committing work

This commit is contained in:
Rick Falkvinge
2013-07-10 14:18:27 +00:00
parent 628e213114
commit 7c25e6ce01
10 changed files with 311 additions and 76 deletions
+6 -3
View File
@@ -95,7 +95,8 @@ namespace Swarmops.Database
{
XmlSerializer serializer = new XmlSerializer(typeof(Configuration));
using (TextWriter writeFileStream = new StreamWriter(GetConfigurationFileName()))
string fileName = GetConfigurationFileName();
using (TextWriter writeFileStream = new StreamWriter(fileName))
{
serializer.Serialize(writeFileStream, configuration);
}
@@ -118,14 +119,16 @@ namespace Swarmops.Database
return "/etc/swarmops/database.config";
}
else if (HttpContext.Current != null)
else if (System.Diagnostics.Debugger.IsAttached)
{
// Dev web process
// Dev web process. This will throw if we're not in a HttpContext and trying to debug something else.
return HttpContext.Current.Server.MapPath ("~/database.config");
}
else
{
throw new NotImplementedException("Invalid state");
// Dev console process
return "database.config"; // Each dev needs to set the working directory to the Console directory when debugging