From: Ben Soares Date: Fri, 1 Nov 2024 11:41:56 +0000 (+0000) Subject: JAL-4474 Added -Force option to all Get-Item calls in Readlink-f function in jalview.ps1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1da3b80194892879ba275911738cdb4372a29ad4;p=jalview.git JAL-4474 Added -Force option to all Get-Item calls in Readlink-f function in jalview.ps1 --- diff --git a/utils/getdown/bin/jalview.ps1 b/utils/getdown/bin/jalview.ps1 index ade0089..d58f2bd 100755 --- a/utils/getdown/bin/jalview.ps1 +++ b/utils/getdown/bin/jalview.ps1 @@ -60,20 +60,20 @@ function Readlink-f { return $null } $path_components = @() - $dir = Get-Item $Link + $dir = Get-Item $Link -Force while ( $dir -ne $null ) { while ( $dir.Target -ne $null ) { # [System.IO.Path]::Combine caters for a multitude of sins that it's almost impossible to deal with with Join-Path - $dir = Get-Item ([System.IO.Path]::GetFullPath( [System.IO.Path]::Combine( (Split-Path $dir -Parent), $dir.Target ))) + $dir = Get-Item ([System.IO.Path]::GetFullPath( [System.IO.Path]::Combine( (Split-Path $dir -Parent), $dir.Target ))) -Force } $parent = Split-Path -Path $dir -Parent $path_components = @( (Split-Path -Path $dir -Leaf) ) + $path_components $dir = Readlink-f $parent ($iteration_count + 1) } - $real = Get-Item "/" + $real = Get-Item "/" -Force foreach ( $component in $path_components) { # [System.IO.Path]::Combine caters for a multitude of sins that it's almost impossible to deal with with Join-Path - $real = Get-Item ([System.IO.Path]::GetFullPath( [System.IO.Path]::Combine( $real, $component ))) + $real = Get-Item ([System.IO.Path]::GetFullPath( [System.IO.Path]::Combine( $real, $component ))) -Force } $real }