From 9586ff5036f9b7995276adcabf713ee780115d88 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Fri, 12 Mar 2021 20:41:33 +0000 Subject: [PATCH] JAL-3830 powershell wrapper tested and fixed --- utils/getdown/jalviewc.ps1 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) mode change 100644 => 100755 utils/getdown/jalviewc.ps1 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" -- 1.7.10.2