Skip to content

Commit

Permalink
Fix bug in Step-Up cding to root drive on Windows. (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickcox authored Mar 5, 2021
1 parent 04790f1 commit cc394b6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changes

## [2.9.3]
- Fix regression where `Step-Up` failed to change to root directory on Windows, thanks @thorstenkampe

## [2.9.2]
- Fix regression where `cd-extras` not starting on PowerShell v5, thanks @jetersen!
- Fix a bug where truncated menu completion entries not emitting unicode ellipsis character
Expand Down
5 changes: 2 additions & 3 deletions cd-extras/cd-extras.psd1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
RootModule = 'cd-extras.psm1'
ModuleVersion = '2.9.2'
ModuleVersion = '2.9.3'
GUID = '206fccbd-dc96-4b23-908c-5ac821372e16'

Author = 'Nick Cox'
Expand All @@ -16,8 +16,7 @@
PrivateData = @{
PSData = @{
ReleaseNotes = '
- Fix regression where `cd-extras` not starting on PowerShell v5, thanks @jetersen!
- Fix a bug where truncated menu completion entries not emitting unicode ellipsis character'
- Fix regression where `Step-Up` failed to change to root directory on Windows'
Tags = @('cd+', 'cd-', 'AUTO_CD', 'CD_PATH', 'CDABLE_VARS', 'bash', 'zsh')
LicenseUri = 'https://github.com/nickcox/cd-extras/blob/master/LICENSE'
ProjectUri = 'https://github.com/nickcox/cd-extras'
Expand Down
2 changes: 1 addition & 1 deletion cd-extras/public/Get-Up.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function Get-Up {

Process {

$ancestors = (Get-Ancestors -From $From).Path
$ancestors = @((Get-Ancestors -From $From).Path)

if ($PSCmdlet.ParameterSetName -eq 'n') {

Expand Down
12 changes: 12 additions & 0 deletions tests/cd-extras.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,18 @@ Describe 'cd-extras' {
Get-Up | Should -Be (Resolve-Path ..).Path
}

It 'can find the root directory from child' {
cd $PSScriptRoot
(Get-Ancestors)[-2] | cd
Get-Up | Should -Be $PWD.Drive.Root
}

It 'can find the root directory from child by name' {
cd $PSScriptRoot
(Get-Ancestors)[-2] | cd
Get-Up $PWD.Drive.Root.Substring(0, 1) | Should -Be $PWD.Drive.Root
}

It 'can take an arbitrary path' {
Get-Up -From powershell\docs\git | Should -Be (Resolve-Path powershell\docs).Path
}
Expand Down

0 comments on commit cc394b6

Please sign in to comment.