Skip to content

Commit cfaa9df

Browse files
committed
Merge pull request #125 from Particular/ntk/fix-crlf-release
Fix line endings
2 parents 5fa253c + c011a59 commit cfaa9df

File tree

16 files changed

+659
-659
lines changed

16 files changed

+659
-659
lines changed

installer/License.rtf

Lines changed: 86 additions & 86 deletions
Large diffs are not rendered by default.
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
namespace ServicePulse.Host.Commands
2-
{
3-
using System.IO;
4-
using System.Text.RegularExpressions;
5-
using Hosting;
6-
7-
internal abstract class AbstractCommand
8-
{
9-
public abstract void Execute(HostArguments args);
10-
11-
public static void UpdateConfig(string directoryPath, string serviceControlUrl)
12-
{
13-
var appJsPath = Path.Combine(directoryPath, "config.js");
14-
var appJsCode = File.ReadAllText(appJsPath);
15-
File.WriteAllText(appJsPath,
16-
Regex.Replace(appJsCode, @"(service_control_url: ')([\w:/]*)(')", "$1" + serviceControlUrl + "$3"));
17-
}
18-
}
1+
namespace ServicePulse.Host.Commands
2+
{
3+
using System.IO;
4+
using System.Text.RegularExpressions;
5+
using Hosting;
6+
7+
internal abstract class AbstractCommand
8+
{
9+
public abstract void Execute(HostArguments args);
10+
11+
public static void UpdateConfig(string directoryPath, string serviceControlUrl)
12+
{
13+
var appJsPath = Path.Combine(directoryPath, "config.js");
14+
var appJsCode = File.ReadAllText(appJsPath);
15+
File.WriteAllText(appJsPath,
16+
Regex.Replace(appJsCode, @"(service_control_url: ')([\w:/]*)(')", "$1" + serviceControlUrl + "$3"));
17+
}
18+
}
1919
}
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
namespace ServicePulse.Host.Commands
2-
{
3-
using System;
4-
using System.Collections.Generic;
5-
using Hosting;
6-
7-
internal class CommandRunner
8-
{
9-
public CommandRunner(List<Type> commands)
10-
{
11-
this.commands = commands;
12-
}
13-
14-
public void Execute(HostArguments args)
15-
{
16-
foreach (var commandType in commands)
17-
{
18-
var command = (AbstractCommand)Activator.CreateInstance(commandType);
19-
command.Execute(args);
20-
}
21-
}
22-
23-
readonly List<Type> commands;
24-
}
1+
namespace ServicePulse.Host.Commands
2+
{
3+
using System;
4+
using System.Collections.Generic;
5+
using Hosting;
6+
7+
internal class CommandRunner
8+
{
9+
public CommandRunner(List<Type> commands)
10+
{
11+
this.commands = commands;
12+
}
13+
14+
public void Execute(HostArguments args)
15+
{
16+
foreach (var commandType in commands)
17+
{
18+
var command = (AbstractCommand)Activator.CreateInstance(commandType);
19+
command.Execute(args);
20+
}
21+
}
22+
23+
readonly List<Type> commands;
24+
}
2525
}
Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
1-
namespace ServicePulse.Host.Commands
2-
{
3-
using System;
4-
using System.IO;
5-
using System.Linq;
6-
using System.Reflection;
7-
using Hosting;
8-
9-
internal class ExtractCommand : AbstractCommand
10-
{
11-
public override void Execute(HostArguments args)
12-
{
13-
ExtractResources(args.OutputPath);
14-
15-
if (String.IsNullOrEmpty(args.ServiceControlUrl))
16-
{
17-
return;
18-
}
19-
20-
UpdateConfig(args.OutputPath, args.ServiceControlUrl);
21-
}
22-
23-
static void ExtractResources(string directoryPath)
24-
{
25-
var assembly = Assembly.GetExecutingAssembly();
26-
var resources = assembly.GetManifestResourceNames().Where(x => x.StartsWith(@"app\"));
27-
foreach (var resourceName in resources)
28-
{
29-
using (var resourceStream = assembly.GetManifestResourceStream(resourceName))
30-
{
31-
var fileName = resourceName.Replace(@"app\", String.Empty);
32-
var destinationPath = Path.Combine(directoryPath, fileName);
33-
Console.WriteLine("Unpacking '{0}' to '{1}'...", fileName, destinationPath);
34-
35-
Directory.CreateDirectory(Path.GetDirectoryName(destinationPath));
36-
37-
using (Stream file = File.OpenWrite(destinationPath))
38-
{
39-
resourceStream.CopyTo(file);
40-
file.Flush();
41-
}
42-
}
43-
}
44-
}
45-
}
1+
namespace ServicePulse.Host.Commands
2+
{
3+
using System;
4+
using System.IO;
5+
using System.Linq;
6+
using System.Reflection;
7+
using Hosting;
8+
9+
internal class ExtractCommand : AbstractCommand
10+
{
11+
public override void Execute(HostArguments args)
12+
{
13+
ExtractResources(args.OutputPath);
14+
15+
if (String.IsNullOrEmpty(args.ServiceControlUrl))
16+
{
17+
return;
18+
}
19+
20+
UpdateConfig(args.OutputPath, args.ServiceControlUrl);
21+
}
22+
23+
static void ExtractResources(string directoryPath)
24+
{
25+
var assembly = Assembly.GetExecutingAssembly();
26+
var resources = assembly.GetManifestResourceNames().Where(x => x.StartsWith(@"app\"));
27+
foreach (var resourceName in resources)
28+
{
29+
using (var resourceStream = assembly.GetManifestResourceStream(resourceName))
30+
{
31+
var fileName = resourceName.Replace(@"app\", String.Empty);
32+
var destinationPath = Path.Combine(directoryPath, fileName);
33+
Console.WriteLine("Unpacking '{0}' to '{1}'...", fileName, destinationPath);
34+
35+
Directory.CreateDirectory(Path.GetDirectoryName(destinationPath));
36+
37+
using (Stream file = File.OpenWrite(destinationPath))
38+
{
39+
resourceStream.CopyTo(file);
40+
file.Flush();
41+
}
42+
}
43+
}
44+
}
45+
}
4646
}
Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
namespace ServicePulse.Host.Commands
2-
{
3-
using System;
4-
using System.Collections;
5-
using Hosting;
6-
7-
internal class InstallCommand : ServiceCommand
8-
{
9-
public InstallCommand() : base(installer => installer.Install(new Hashtable()))
10-
{
11-
}
12-
13-
public override void Execute(HostArguments args)
14-
{
15-
if (IsServiceInstalled(args.ServiceName))
16-
{
17-
Console.ForegroundColor = ConsoleColor.Red;
18-
Console.Out.WriteLine("The '{0}' service is already installed.", args.ServiceName);
19-
Console.ResetColor();
20-
21-
return;
22-
}
23-
24-
ExecuteInternal(args);
25-
}
26-
}
1+
namespace ServicePulse.Host.Commands
2+
{
3+
using System;
4+
using System.Collections;
5+
using Hosting;
6+
7+
internal class InstallCommand : ServiceCommand
8+
{
9+
public InstallCommand() : base(installer => installer.Install(new Hashtable()))
10+
{
11+
}
12+
13+
public override void Execute(HostArguments args)
14+
{
15+
if (IsServiceInstalled(args.ServiceName))
16+
{
17+
Console.ForegroundColor = ConsoleColor.Red;
18+
Console.Out.WriteLine("The '{0}' service is already installed.", args.ServiceName);
19+
Console.ResetColor();
20+
21+
return;
22+
}
23+
24+
ExecuteInternal(args);
25+
}
26+
}
2727
}
Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
namespace ServicePulse.Host.Commands
2-
{
3-
using System;
4-
using System.Diagnostics;
5-
using Hosting;
6-
7-
internal class RunCommand : AbstractCommand
8-
{
9-
public override void Execute(HostArguments args)
10-
{
11-
using (var service = new Host(args))
12-
{
13-
service.Run();
14-
15-
if (!Environment.UserInteractive)
16-
{
17-
return;
18-
}
19-
20-
Process.Start(args.Url);
21-
Console.WriteLine("Running on {0}", args.Url);
22-
Console.WriteLine("Press enter to exit");
23-
Console.ReadLine();
24-
}
25-
}
26-
}
1+
namespace ServicePulse.Host.Commands
2+
{
3+
using System;
4+
using System.Diagnostics;
5+
using Hosting;
6+
7+
internal class RunCommand : AbstractCommand
8+
{
9+
public override void Execute(HostArguments args)
10+
{
11+
using (var service = new Host(args))
12+
{
13+
service.Run();
14+
15+
if (!Environment.UserInteractive)
16+
{
17+
return;
18+
}
19+
20+
Process.Start(args.Url);
21+
Console.WriteLine("Running on {0}", args.Url);
22+
Console.WriteLine("Press enter to exit");
23+
Console.ReadLine();
24+
}
25+
}
26+
}
2727
}

0 commit comments

Comments
 (0)