Skip to content

Commit 0a56972

Browse files
committed
[ci skip] cleanup
1 parent 786926f commit 0a56972

2 files changed

Lines changed: 10 additions & 13 deletions

File tree

src/Server/Config.cs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ static Config()
1818
DiskProvider = new PhysicalFileProvider(new FilePath(Environment.CurrentDirectory) / "config");
1919
}
2020

21-
public static bool ShouldConfigureVersionPinning(string[] args,
21+
public static bool UseVersionPinning(string[] args,
2222
[MaybeNullWhen(false)] out JsonConfigurationSource jcs)
2323
{
2424
jcs = null;
2525

26-
if (args.Any(x => x.EqualsAnyIgnoreCase("--gen-version-pinning")))
26+
if (args.Any(x => x.EqualsIgnoreCase("--gen-version-pinning")))
2727
{
2828
if (!File.Exists("config/versionPinning.json"))
2929
File.WriteAllText("config/versionPinning.json",
@@ -42,17 +42,14 @@ public static bool ShouldConfigureVersionPinning(string[] args,
4242
}
4343

4444
if (File.Exists("config/versionPinning.json"))
45-
jcs = VersionPinningSource();
45+
jcs = new()
46+
{
47+
FileProvider = DiskProvider,
48+
Optional = true,
49+
ReloadOnChange = false,
50+
Path = "versionPinning.json"
51+
};
4652

4753
return jcs != null;
4854
}
49-
50-
public static JsonConfigurationSource VersionPinningSource() =>
51-
new()
52-
{
53-
FileProvider = DiskProvider,
54-
Optional = true,
55-
ReloadOnChange = false,
56-
Path = "versionPinning.json"
57-
};
5855
}

src/Server/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
var builder = WebApplication.CreateBuilder(args);
1010

11-
if (Config.ShouldConfigureVersionPinning(args, out var configSource))
11+
if (Config.UseVersionPinning(args, out var configSource))
1212
builder.Configuration.Sources.Add(configSource);
1313

1414
if (CommandLineState.ListenPort != null)

0 commit comments

Comments
 (0)