Skip to content

Commit

Permalink
Install choco if not already present (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanbergstrom authored Apr 2, 2021
1 parent a5e0ccd commit 150fc72
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.1.1] - 2021-04-02
#### Fixed
* Chocolatey once again will be installed automatically if not already present

## [3.1.0] - 2021-04-02
#### Removed
* No longer using Native API method for interacting with choco.exe due to [a compatibility issue between the Chocolatey API and Chocolatey.org](https://github.com/jianyunt/ChocolateyGet/issues/24)
Expand Down
2 changes: 1 addition & 1 deletion src/ChocolateyGet.psd1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
RootModule = 'ChocolateyGet.psm1'
ModuleVersion = '3.1.0'
ModuleVersion = '3.1.1'
GUID = 'c1735ed7-8b2f-426a-8cbc-b7feb6b8288d'
Author = 'Jianyun'
Copyright = ''
Expand Down
11 changes: 6 additions & 5 deletions src/ChocolateyGet.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ $script:AcceptLicense = "AcceptLicense"
# Define choco related variables
$script:ChocoExeName = 'choco.exe'

if (-not (Get-ChocoPath)) {
Write-Debug ("Choco not already installed")
$ChocoExePath = Install-ChocoBinaries
}

# Utility variables
$script:FastReferenceRegex = "(?<name>[^#]*)#(?<version>[^\s]*)#(?<source>[^#]*)"
$script:ChocoSourcePropertyNames = @(
Expand Down Expand Up @@ -45,3 +40,9 @@ Get-ChildItem $ScriptPath/public -Recurse -Filter '*.ps1' -File | ForEach-Object
Export-ModuleMember $_.Name
}
}

# Install Chocolatey if not already present
if (-not (Get-ChocoPath)) {
Write-Debug ("Choco not already installed")
Install-ChocoBinaries
}

0 comments on commit 150fc72

Please sign in to comment.