mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 17:59:11 +08:00
add resolve path for flatten directory function
This commit is contained in:
parent
0b163d43ab
commit
f05c77e53c
@ -48,6 +48,7 @@ function Create-Archive($source, $target, $params) {
|
|||||||
# If directory contains only one child directory
|
# If directory contains only one child directory
|
||||||
# Flatten it instead
|
# Flatten it instead
|
||||||
function Flatten-Directory($name) {
|
function Flatten-Directory($name) {
|
||||||
|
$name = Resolve-Path $name
|
||||||
$child = (Get-Childitem $name)[0]
|
$child = (Get-Childitem $name)[0]
|
||||||
Write-Verbose "Moving the '$child' directory's content to '$name'"
|
Write-Verbose "Moving the '$child' directory's content to '$name'"
|
||||||
Rename-Item $name -NewName "$($name)_moving"
|
Rename-Item $name -NewName "$($name)_moving"
|
||||||
|
Loading…
Reference in New Issue
Block a user