Skip to content

Commit 270b6c4

Browse files
dependabot[bot]kzu
authored andcommitted
Bump DotNetConfig from 1.0.0-rc.2 to 1.0.6
Bumps [DotNetConfig](https://github.com/dotnetconfig/dotnet-config) from 1.0.0-rc.2 to 1.0.6. - [Release notes](https://github.com/dotnetconfig/dotnet-config/releases) - [Changelog](https://github.com/dotnetconfig/dotnet-config/blob/main/changelog.md) - [Commits](dotnetconfig/dotnet-config@v1.0.0-rc.2...v1.0.6) --- updated-dependencies: - dependency-name: DotNetConfig dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
1 parent 0b334b6 commit 270b6c4

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

src/VisualStudio.Tests/CommandFactoryTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public async Task when_update_command_and_self_option_is_specified_then_update_s
9999
public async Task when_saved_command_is_specified_then_saved_command_is_created()
100100
{
101101
var config = DotNetConfig.Config.Build(Path.GetTempFileName());
102-
config.SetString(Commands.DotNetConfig.Section, Commands.DotNetConfig.SubSection, "foo", "update|main", null);
102+
config = config.SetString(Commands.DotNetConfig.Section, Commands.DotNetConfig.SubSection, "foo", "update|main", null);
103103

104104
var commandFactory = new CommandFactory(config);
105105

src/VisualStudio.Tests/VersionCheckerTests.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ public async Task when_showing_version_for_old_version_then_renders_latest_tag()
5959
public async Task when_showing_version_after_week_from_last_check_then_updates_to_latest()
6060
{
6161
var config = Config.Build(Path.GetTempFileName());
62-
config.SetString("vs", "latest", "0.1.5");
63-
config.SetDateTime("vs", "checked", DateTime.Now - TimeSpan.FromDays(10));
62+
config = config
63+
.SetString("vs", "latest", "0.1.5", ConfigLevel.Local)
64+
.SetDateTime("vs", "checked", DateTime.Now - TimeSpan.FromDays(10), ConfigLevel.Local);
6465

6566
var checker = new VersionChecker(new Version(0, 1, 1), config);
6667

@@ -79,8 +80,9 @@ public async Task when_showing_version_after_week_from_last_check_then_updates_t
7980
public async Task when_showing_update_same_week_then_returns_last_checked()
8081
{
8182
var config = Config.Build(Path.GetTempFileName());
82-
config.SetString("vs", "latest", "99.99.99");
83-
config.SetDateTime("vs", "checked", (DateTime.Now - TimeSpan.FromDays(3)));
83+
config = config
84+
.SetString("vs", "latest", "99.99.99", ConfigLevel.Local)
85+
.SetDateTime("vs", "checked", (DateTime.Now - TimeSpan.FromDays(3)), ConfigLevel.Local);
8486

8587
var checker = new VersionChecker(new Version(0, 1, 1), config);
8688

src/VisualStudio.Tests/VisualStudio.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9+
<PackageReference Include="DotNetConfig" Version="1.0.6" />
910
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
1011
<PackageReference Include="Moq" Version="4.16.1" />
1112
<PackageReference Include="xunit" Version="2.4.1" />

src/VisualStudio/VersionChecker.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class VersionChecker
1616
static readonly Version developmentVersion = new Version(42, 42, 42, 0);
1717

1818
readonly Version currentVersion;
19-
readonly ConfigSection configuration;
2019
readonly ConfigLevel saveLevel;
2120
readonly string repositoryUrl;
2221
readonly Task<Version> getLatest;
22+
ConfigSection configuration;
2323

2424
public VersionChecker()
2525
: this(new Version(ThisAssembly.Info.Version), Config.Build(ConfigLevel.Global), saveLevel: ConfigLevel.Global)
@@ -100,9 +100,10 @@ async Task<Version> GetLatestAsync()
100100
{
101101
var latestTagUrl = response.Headers.Location.ToString();
102102
latestVersion = new Version(latestTagUrl.Split('/').Last().Trim('v'));
103-
configuration.SetString("latest", latestVersion.ToString(3), saveLevel);
104-
// NOTE: we only save checked date if we succeeded at checking latest.
105-
configuration.SetDateTime("checked", DateTime.Now, saveLevel);
103+
configuration = configuration
104+
.SetString("latest", latestVersion.ToString(3), saveLevel)
105+
// NOTE: we only save checked date if we succeeded at checking latest.
106+
.SetDateTime("checked", DateTime.Now, saveLevel);
106107
}
107108
}
108109

src/VisualStudio/VisualStudio.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ See full documentation at $(PackageProjectUrl).
4646
<PackageReference Include="ThisAssembly" Version="1.0.8" PrivateAssets="all" />
4747
<PackageReference Include="System.Management" Version="5.0.0" />
4848
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="3.10.0" />
49-
<PackageReference Include="DotNetConfig" Version="1.0.0-rc.2" />
49+
<PackageReference Include="DotNetConfig" Version="1.0.6" />
5050
</ItemGroup>
5151

5252
<ItemGroup>

0 commit comments

Comments
 (0)