Skip to content

Commit

Permalink
mage GetChocolatey static
Browse files Browse the repository at this point in the history
  • Loading branch information
mwrock committed Jan 9, 2017
1 parent 6e6a8c8 commit 78998fd
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Boxstarter.Chocolatey/invoke-chocolatey.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ function Invoke-Chocolatey($chocoArgs) {
Write-BoxstarterMessage "Current runtime is $($PSVersionTable.CLRVersion)" -Verbose
$refs = @(
"$($Boxstarter.BaseDir)/boxstarter.chocolatey/chocolatey/log4net.dll",
"$($Boxstarter.BaseDir)/boxstarter.chocolatey/chocolatey/chocolatey.dll"
"$($Boxstarter.BaseDir)/boxstarter.chocolatey/chocolatey/chocolatey.dll",
"$($Boxstarter.BaseDir)/boxstarter.chocolatey/chocolatey/AlphaFS.dll"
)
$refs | % {
Write-BoxstarterMessage "Adding types from $_" -Verbose
Expand Down Expand Up @@ -32,12 +33,14 @@ namespace Boxstarter
public class ChocolateyWrapper
{
private GetChocolatey _choco;
private static GetChocolatey _choco;
public ChocolateyWrapper(string boxstarterSetup, PSHostUserInterface ui, bool logDebug, string logPath, bool quiet) {
_choco = Lets.GetChocolatey();
var psService = new PowershellService(new DotNetFileSystem(), boxstarterSetup);
_choco.RegisterContainerComponent<IPowershellService>(() => psService);
if (_choco == null) {
_choco = Lets.GetChocolatey();
var psService = new PowershellService(new DotNetFileSystem(), boxstarterSetup);
_choco.RegisterContainerComponent<IPowershellService>(() => psService);
}
_choco.SetCustomLogging(new PsLogger(ui, logDebug, logPath, quiet));
}
Expand Down Expand Up @@ -242,7 +245,7 @@ namespace Boxstarter
}

Enter-BoxstarterLogable {
Write-BoxstarterMessage "calling choco now with $chocoArgs" -verbose
Write-BoxstarterMessage "calling choco now with $chocoArgs" -Verbose
$cd = [System.IO.Directory]::GetCurrentDirectory()
try {
# Chocolatey.dll uses GetCurrentDirectory which is not quite right
Expand Down

2 comments on commit 78998fd

@riezebosch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stealing my thunder 😢

@mwrock
Copy link
Member Author

@mwrock mwrock commented on 78998fd Jan 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry I did steal the static reference from your PR. It was just alot easier that way because I had a few commits in a local master that conflicted with yours (bad open source etiquette I know). Thanks so much for weighing in because otherwise likely nothing would have happened any time soon.

Please sign in to comment.