git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d68ce66
)
JAL-3830 powershell follows symlinks as they do exist in NTFS, and of course in linux
author
Ben Soares
<b.soares@dundee.ac.uk>
Sun, 14 Mar 2021 01:27:43 +0000
(
01:27
+0000)
committer
Ben Soares
<b.soares@dundee.ac.uk>
Sun, 14 Mar 2021 01:27:43 +0000
(
01:27
+0000)
utils/getdown/jalviewc.ps1
patch
|
blob
|
history
diff --git
a/utils/getdown/jalviewc.ps1
b/utils/getdown/jalviewc.ps1
index
44746b1
..
d3bde6a
100755
(executable)
--- a/
utils/getdown/jalviewc.ps1
+++ b/
utils/getdown/jalviewc.ps1
@@
-3,8
+3,9
@@
# save args and first parameter
$ARGS = $args
$ARG1 = $args[0]
# save args and first parameter
$ARGS = $args
$ARG1 = $args[0]
-# parent dir of this script (should be the getdown app dir)
-$DIR = Split-Path $MyInvocation.MyCommand.Path -Parent
+# parent dir of this script (should be the getdown app dir). Follow symlinks.
+$TARGET = ( Get-Item $MyInvocation.MyCommand.Path ).Target
+$DIR = ( $TARGET -eq $null ) ? ( Split-Path $MyInvocation.MyCommand.Path -Parent ) : ( Split-Path $TARGET -Parent )
# insert an "-open" parameter to Jalview's ARGS if ARG1 is non-zero-length, and not "open" or starts with a "-"
if ( $ARG1.length -gt 0 -and ( -not $ARG1.StartsWith("-") ) -and $ARG1 -cne "open" ) {
# insert an "-open" parameter to Jalview's ARGS if ARG1 is non-zero-length, and not "open" or starts with a "-"
if ( $ARG1.length -gt 0 -and ( -not $ARG1.StartsWith("-") ) -and $ARG1 -cne "open" ) {
@@
-16,7
+17,6
@@
$JAVAEXE = ( $IsWindows ? "java.exe" : "java" )
$JAVA = Join-Path -Path $APPDIR -ChildPath ( "jre/" + ( $IsMacOs ? "Contents/Home/" : "" ) + "bin/${JAVAEXE}" )
$GETDOWNTXT = Join-Path -Path $APPDIR -ChildPath "getdown.txt"
$JAVA = Join-Path -Path $APPDIR -ChildPath ( "jre/" + ( $IsMacOs ? "Contents/Home/" : "" ) + "bin/${JAVAEXE}" )
$GETDOWNTXT = Join-Path -Path $APPDIR -ChildPath "getdown.txt"
-Write-Host "JAVA=$JAVA"
# look for getdown.txt -- needed to create classpath
if ( -not ( Test-Path -Path "${GETDOWNTXT}" ) ) {
throw "Cannot find getdown.txt"
# look for getdown.txt -- needed to create classpath
if ( -not ( Test-Path -Path "${GETDOWNTXT}" ) ) {
throw "Cannot find getdown.txt"