mirror of
https://github.com/cmderdev/cmder.git
synced 2025-02-11 16:00:21 +08:00
use absolute paths for moving items
This commit is contained in:
parent
eede47bfad
commit
ee01f26680
@ -50,10 +50,11 @@ function Create-Archive($source, $target, $params) {
|
|||||||
function Flatten-Directory($name) {
|
function Flatten-Directory($name) {
|
||||||
$name = Resolve-Path $name
|
$name = Resolve-Path $name
|
||||||
$child = (Get-Childitem $name)[0]
|
$child = (Get-Childitem $name)[0]
|
||||||
|
$moving = $($name)_moving
|
||||||
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 "$moving"
|
||||||
Move-Item -Path "$($name)_moving\$child" -Destination $name
|
Move-Item -Path "$child" -Destination "$name"
|
||||||
Remove-Item -Recurse "$($name)_moving"
|
Remove-Item -Recurse "$moving"
|
||||||
}
|
}
|
||||||
|
|
||||||
function Digest-Hash($path) {
|
function Digest-Hash($path) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user