File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff line change 88
99var 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
1414if ( CommandLineState . ListenPort != null )
You can’t perform that action at this time.
0 commit comments