Skip to content

Commit 6cf31db

Browse files
committed
Clean up in forwarder install command
1 parent f2156a7 commit 6cf31db

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

seqcli.sln.DotSettings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@
3434
<s:Boolean x:Key="/Default/UserDictionary/Words/=STORAGEPATH/@EntryIndexedValue">True</s:Boolean>
3535
<s:Boolean x:Key="/Default/UserDictionary/Words/=subcommand/@EntryIndexedValue">True</s:Boolean>
3636
<s:Boolean x:Key="/Default/UserDictionary/Words/=syslogdt/@EntryIndexedValue">True</s:Boolean>
37+
<s:Boolean x:Key="/Default/UserDictionary/Words/=tcpip/@EntryIndexedValue">True</s:Boolean>
3738
<s:Boolean x:Key="/Default/UserDictionary/Words/=Tokenizes/@EntryIndexedValue">True</s:Boolean>
3839
<s:Boolean x:Key="/Default/UserDictionary/Words/=trailingindent/@EntryIndexedValue">True</s:Boolean>
3940
<s:Boolean x:Key="/Default/UserDictionary/Words/=unawaited/@EntryIndexedValue">True</s:Boolean>
4041
<s:Boolean x:Key="/Default/UserDictionary/Words/=Unclosable/@EntryIndexedValue">True</s:Boolean>
4142
<s:Boolean x:Key="/Default/UserDictionary/Words/=urlacl/@EntryIndexedValue">True</s:Boolean>
43+
<s:Boolean x:Key="/Default/UserDictionary/Words/=winmgmt/@EntryIndexedValue">True</s:Boolean>
4244
<s:Boolean x:Key="/Default/UserDictionary/Words/=xmpweb/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

src/SeqCli/Cli/Commands/Forwarder/InstallCommand.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void Install()
101101
if (netshResult != 0)
102102
Console.WriteLine($"Could not add URL reservation for {listenUri}: `netsh` returned {netshResult}; ignoring");
103103

104-
var exePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory!, Program.BinaryName);
104+
var exePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Program.BinaryName);
105105
var forwarderRunCmdline = $"\"{exePath}\" forwarder run --pre --storage=\"{_storagePath.StorageRootPath}\"";
106106

107107
var binPath = forwarderRunCmdline.Replace("\"", "\\\"");
@@ -117,7 +117,7 @@ void Install()
117117
var sc = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "sc.exe");
118118
if (0 != CaptiveProcess.Run(sc, scCmdline, Console.WriteLine, Console.WriteLine))
119119
{
120-
throw new ArgumentException("Service setup failed");
120+
throw new ArgumentException("Service setup failed.");
121121
}
122122

123123
Console.WriteLine("Setting service restart policy...");
@@ -132,8 +132,6 @@ void Install()
132132

133133
void GiveFullControl(string target)
134134
{
135-
if (target == null) throw new ArgumentNullException(nameof(target));
136-
137135
if (!Directory.Exists(target))
138136
Directory.CreateDirectory(target);
139137

@@ -147,7 +145,7 @@ void GiveFullControl(string target)
147145
static string MakeListenUriReservationPattern(string uri)
148146
{
149147
var listenUri = uri.Replace("localhost", "+");
150-
if (!listenUri.EndsWith("/"))
148+
if (!listenUri.EndsWith('/'))
151149
listenUri += "/";
152150
return listenUri;
153151
}

0 commit comments

Comments
 (0)