Skip to content

Commit

Permalink
Fixes and prep candidate release
Browse files Browse the repository at this point in the history
  • Loading branch information
codyduong committed Apr 12, 2024
1 parent 13f6c2c commit a8cfece
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
10 changes: 10 additions & 0 deletions alias-tips/Public/Find-AliasTips.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,15 @@ function Find-AliasTips {
}
})

$script:AliasTipsProxyFunctionRegex, $script:AliasTipsProxyFunctionRegexNoArgs = $null
$jobs = Get-Job -Name "FindAliasTipsJob" -ErrorAction SilentlyContinue
if ($null -ne $jobs) {
foreach ($job in $jobs) {
Stop-Job -Job $job
Remove-Job -Job $job
}
}
Start-RegexThreadJob

Set-Content -Path $AliasTipsHashFile -Value $Value
}
2 changes: 1 addition & 1 deletion alias-tips/alias-tips.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ PrivateData = @{
ReleaseNotes = 'https://github.com/codyduong/powershell-alias-tips/releases'

# Prerelease version
Prerelease = "rc1"
Prerelease = "rc2"
} # End of PSData hashtable

} # End of PrivateData hashtable
Expand Down
12 changes: 5 additions & 7 deletions tests/unit/Find-Alias.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ InModuleScope 'alias-tips' {
Set-Alias -Name 'as_s' -Value 'as_s_test'

# This might cause a problem if you already aliased Out-Null

function as_f {
Out-Null $args
as_base $args
}

# ENSURE this remains after as_f, that way declaration order doesn't override that as_f is just a better alias recommendation
function as_f_long {
Out-Null $args
as_base $args
}

Find-AliasTips
Expand All @@ -33,7 +32,7 @@ InModuleScope 'alias-tips' {
}

it 'simple asf' {
Find-Alias 'Out-Null foo' |
Find-Alias 'as_base foo' |
Should -Be 'as_f foo'
}

Expand Down Expand Up @@ -66,14 +65,13 @@ InModuleScope 'alias-tips' {

Remove-Item Env:\PESTER -ErrorAction SilentlyContinue
Remove-Item alias:as_s -ErrorAction SilentlyContinue
Remove-Item function:as_base -ErrorAction SilentlyContinue
Remove-Item function:as_f -ErrorAction SilentlyContinue
Remove-Item function:as_f_long -ErrorAction SilentlyContinue

Find-AliasTips

Get-Job -Name "FindAliasTipsJob" -ErrorAction SilentlyContinue | Stop-Job -PassThru | Remove-Job

# Find-AliasTips
Find-AliasTips
}
}
}

0 comments on commit a8cfece

Please sign in to comment.