Skip to content

Commit 4654a63

Browse files
Add process types enum for later use
1 parent 4af52c4 commit 4654a63

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

src/microstack.configuration/Models/Configuration.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ namespace microstack.configuration.Models
44
{
55
public class Configuration
66
{
7+
public ProcessTypes ProcessType { get; set; }
78
public string StartupProjectPath { get; set; }
89
public string ProjectName { get; set; }
910
public string NextProjectName { get; set; }
@@ -29,4 +30,10 @@ public class Configuration
2930
return (true, string.Empty);
3031
}
3132
}
33+
34+
public enum ProcessTypes
35+
{
36+
Dotnet,
37+
Node
38+
}
3239
}

src/microstack/Handlers/DotnetHandler.cs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,21 @@ public async override Task Handle(IList<Configuration> configurations, bool isVe
5151

5252
private void BuildProcessObjects()
5353
{
54-
_processInfoObjects = _configurations.Select(p => {
54+
_processInfoObjects = _configurations
55+
// .Where(c => c.ProcessType.Equals(ProcessTypes.Dotnet))
56+
.Select(p => {
57+
var processStartInfo = new ProcessStartInfo();
58+
processStartInfo.UseShellExecute = false;
59+
foreach(var confOverride in p.ConfigOverrides)
60+
{
61+
processStartInfo.Environment.Add(confOverride);
62+
}
63+
processStartInfo.FileName = DotNetExe.FullPathOrDefault();
64+
processStartInfo.Arguments = $"run --no-launch-profile --urls \"https://localhost:{p.Port}\"";
65+
processStartInfo.WorkingDirectory = Path.Combine(p.StartupProjectPath);
66+
processStartInfo.RedirectStandardOutput = SetVerbosity(_isVerbose, p.Verbose);
5567

56-
var processStartInfo = new ProcessStartInfo();
57-
processStartInfo.UseShellExecute = false;
58-
foreach(var confOverride in p.ConfigOverrides)
59-
{
60-
processStartInfo.Environment.Add(confOverride);
61-
}
62-
processStartInfo.FileName = DotNetExe.FullPathOrDefault();
63-
processStartInfo.Arguments = $"run --no-launch-profile --urls \"https://localhost:{p.Port}\"";
64-
processStartInfo.WorkingDirectory = Path.Combine(p.StartupProjectPath);
65-
processStartInfo.RedirectStandardOutput = SetVerbosity(_isVerbose, p.Verbose);
66-
67-
return processStartInfo;
68+
return processStartInfo;
6869
}).ToList();
6970
}
7071

0 commit comments

Comments
 (0)