Skip to content

Commit

Permalink
Fixed local logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tig committed Nov 7, 2023
1 parent fbcd2b9 commit 6e01323
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
13 changes: 0 additions & 13 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ if ($null -eq $Version -or "" -eq $Version) {
}

# Ensure we're using the correct version of ConsoleGuiTools
# If there's a local repository, use the latest version from there and set the RequiredVersion in the .psd1 file
# If there's NOT a local repo, use the latest version from the PowerShell Gallery and set the ModuleVersion in the .psd1 file
$PsdPath = "./Source/$($ModuleName).psd1"
$ocgvModule = "Microsoft.PowerShell.ConsoleGuiTools"
"Patching $PsdPath with correct $ocgvModule version"

# Find new version of ConsoleGuiTools in 'local' repository
$localRepository = Get-PSRepository | Where-Object { $_.Name -eq 'local' }
Expand Down Expand Up @@ -71,16 +68,6 @@ if ($null -eq $ocgvVersion) {
$ocgvVersion = "$($v.Major).$($v.Minor).$($v.Build).$($v.Revision)"
" Installing $ocgvModule v$ocgvVersion to ensure it is loaded."
Install-Module $ocgvModule -MinimumVersion $ocgvVersion -Force -Verbose:($PSBoundParameters['Verbose'] -eq $true) -SkipPublisherCheck
" Updating RequiredVersion for $ocgvModule v$ocgvVersion in $PsdPath"
Update-ModuleManifest -RequiredModules @(
@{ModuleName = "PSReadline"; ModuleVersion = "2.1" },
@{ModuleName = $ocgvModule; ModuleVersion = $ocgvVersion }
) -Path $PsdPath -ErrorAction Stop

if (-not $SkipScriptAnalyzer) {
Write-Host "Invoke-ScriptAnalyzer with -Fixfor $PsdPath"
Invoke-ScriptAnalyzer $PsdPath -Settings PSGallery -Fix -ErrorAction Stop
}

$OldModule = Get-Module $ModuleName -ErrorAction SilentlyContinue
if ($OldModule) {
Expand Down
3 changes: 1 addition & 2 deletions Source/F7History.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ Description = 'Press F7 to get a graphical Command History in Powershell.'
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ModuleName = 'PSReadline'; ModuleVersion = '2.1'; },
@{ModuleName = 'Microsoft.PowerShell.ConsoleGuiTools'; ModuleVersion = '0.7.6.3'; })
RequiredModules = @('PSReadline', 'Microsoft.PowerShell.ConsoleGuiTools')

# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()
Expand Down

0 comments on commit 6e01323

Please sign in to comment.