@@ -144,7 +144,7 @@ runs:
144144 mkdir -p ~/.local/bin;
145145 case "${{ steps.find_installer.outputs.file_type }}" in
146146 class)
147- jython_cmd="java -verbose -Dpython.home=' ${installation_path}' -cp ' ${installation_path}/jython.jar' org.python.util.jython \"\$@\""
147+ jython_cmd="java -verbose -Dpython.home=${installation_path} -cp ${installation_path}/jython.jar org.python.util.jython \"\$@\""
148148 ;;
149149
150150 jar)
@@ -153,33 +153,31 @@ runs:
153153 esac
154154
155155 echo "$jython_cmd" >> ~/.local/bin/jython;
156-
157156 chmod +x ~/.local/bin/jython;
158- echo ~/.local/bin >> $GITHUB_PATH
159- # echo ${{ github.workspace }}/.local/bin >> $GITHUB_PATH
157+
158+ - name : Setup Jython alias (pwsh)
159+ if : runner.os == 'Windows'
160+ shell : pwsh
161+ run : |
162+ $installation_path = Convert-Path "${{ inputs.installation-path }}"
163+ if ("${{ steps.find_installer.outputs.file_type }}" -eq "class") {
164+ $jython_cmd = "java -Dpython.home=$installation_path -cp $installation_path\jython.jar org.python.util.jython %*"
165+ } else {
166+ $jython_cmd = "java -jar $installation_path\jython.jar %*"
167+ }
168+
169+ mkdir -Force ~\.local\bin
170+ $jython_cmd | Out-File -FilePath ~\.local\bin\jython.bat
160171
161172 - name : Add to PATH (Linux and macOS)
162173 if : runner.os != 'Windows'
163174 shell : bash
164- run : echo ${HOME}/.local/bin >> $GITHUB_PATH
175+ run : |
176+ echo ~/.local/bin >> $GITHUB_PATH
177+ echo "${{ steps.find_installer.outputs.file_type }}/bin" >> $GITHUB_PATH
165178 - name : Add to PATH (Windows)
166179 if : runner.os == 'Windows'
167180 shell : pwsh
168181 run : |
169- "$env:USERPROFILE\.local\bin" | Out-File -FilePath $env:GITHUB_PATH -Append
170- - name : DEBUG - Powershell
171- shell : pwsh
172- run : |
173- Write-Output "Printing '\$GITHUB_PATH' content:"
174- Get-Content $env:GITHUB_PATH;
175-
176- Write-Output "Printing '~/.local/bin' content:"
177- Get-ChildItem ~/.local/bin;
178- - name : DEBUG - Bash
179- shell : bash
180- run : |
181- echo "Printing '\$GITHUB_PATH' content:"
182- cat $GITHUB_PATH;
183-
184- echo "Printing '~/.local/bin' content:"
185- ls -l ~/.local/bin;
182+ "$HOME\.local\bin" | Out-File -FilePath $env:GITHUB_PATH -Append
183+ Convert-Path "${{ inputs.installation-path }}\bin" | Out-File -FilePath $env:GITHUB_PATH -Append
0 commit comments