Skip to content

Commit

Permalink
(chocolatey#63) Revert push --source alias changes
Browse files Browse the repository at this point in the history
We have decided that the current implementation doesn't work as we would
want for some common use cases, and so this commit removes the changes.

Tests have been left behind and flagged as ignored, so we can make use
of them when a design is agreed on and the functionality is
reimplemented.
  • Loading branch information
vexx32 committed Apr 20, 2023
1 parent 5cbf023 commit 46b9ff8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ public void Should_throw_if_multiple_sources_are_passed()
}

[Fact]
[Ignore("This functionality is not yet implemented. See https://github.com/chocolatey/choco/issues/63")]
public void Should_update_source_if_alias_is_passed()
{
Configuration.Sources = "chocolatey";
Expand All @@ -295,6 +296,7 @@ public void Should_update_source_if_alias_is_passed()
}

[Fact]
[Ignore("This functionality is not yet implemented. See https://github.com/chocolatey/choco/issues/63")]
public void Should_update_source_if_alias_is_passed_via_defaultpushsource()
{
Configuration.Sources = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,6 @@ public virtual void Validate(ChocolateyConfiguration configuration)
throw new ApplicationException("Multiple sources are not support by push command.");
}

var machineSource = configuration.MachineSources.FirstOrDefault(m => m.Name.IsEqualTo(configuration.Sources));
if (machineSource != null)
{
"chocolatey".Log().Debug("Switching source name {0} to actual source value '{1}'.".FormatWith(configuration.Sources, machineSource.Key.ToStringSafe()));

configuration.Sources = machineSource.Key;
}

var remoteSource = new Uri(configuration.Sources);
if (string.IsNullOrWhiteSpace(configuration.PushCommand.Key) && !remoteSource.IsUnc && !remoteSource.IsFile)
{
Expand Down

0 comments on commit 46b9ff8

Please sign in to comment.