From: Ben Soares Date: Fri, 12 Mar 2021 20:41:33 +0000 (+0000) Subject: JAL-3830 powershell wrapper tested and fixed X-Git-Tag: Release_2_11_2_0~63 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9586ff5036f9b7995276adcabf713ee780115d88;p=jalview.git JAL-3830 powershell wrapper tested and fixed --- diff --git a/utils/getdown/jalviewc.ps1 b/utils/getdown/jalviewc.ps1 old mode 100644 new mode 100755 index ff4d6d8..300bd9e --- a/utils/getdown/jalviewc.ps1 +++ b/utils/getdown/jalviewc.ps1 @@ -1,3 +1,5 @@ +#!/usr/bin/env pwsh + # save first parameter $ARGS = $args $ARG1 = $args[0] @@ -10,8 +12,8 @@ if ( $ARG1.length -gt 0 -and (-not $ARG1.StartsWith("-")) -and $ARG1 -ne "open" } $APPDIR = $DIR -$JAVA = "${APPDIR}/jre/bin/java.exe" -$GETDOWNTXT = "${APPDIR}/getdown.txt" +$JAVA = "${APPDIR}\jre\bin\java.exe" +$GETDOWNTXT = "${APPDIR}\getdown.txt" if (-not (Test-Path -Path "${GETDOWNTXT}")) { throw "Cannot find getdown.txt" @@ -22,7 +24,7 @@ if (-not (Test-Path -Path "${JAVA}")) { $JAVA = "java.exe" } -$CLASSPATH = (Select-String -Path "${GETDOWNTXT}" -AllMatches -Pattern "code\s*=\s*(.*)$" | foreach { "$DIR/$($_.Matches.Groups[1].Value)" }) -join ":" +$CLASSPATH = (Select-String -Path "${GETDOWNTXT}" -AllMatches -Pattern "code\s*=\s*(.*)$" | foreach { "$DIR\$($_.Matches.Groups[1].Value -replace "/", "\")" }) -join ";" -Invoke-Expression -Command "${JAVA} -cp ${CLASSPATH} jalview.bin.Launcher $ARGS" +Invoke-Expression -Command "${JAVA} -cp '${CLASSPATH}' jalview.bin.Launcher $ARGS"