Skip to content

Commit

Permalink
Fix .bat errorlevel handling with pwsh.exe check (JabRef#8965)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobi0 authored Jul 11, 2022
1 parent 354c7f8 commit 2a82b9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed an issue where removing several groups deletes only one of them. [#8390](https://github.com/JabRef/jabref/issues/8390)
- We fixed an issue where the Sidepane (groups, web search and open office) width is not remembered after restarting JabRef. [#8907](https://github.com/JabRef/jabref/issues/8907)
- We fixed a bug where switching between themes will cause an error/exception. [#8939](https://github.com/JabRef/jabref/pull/8939)
- We fixed a bug where files that were deleted in the source bibtex file were kept in the index. [8962](https://github.com/JabRef/jabref/pull/8962)
- We fixed a bug where files that were deleted in the source bibtex file were kept in the index. [#8962](https://github.com/JabRef/jabref/pull/8962)
- We fixed "Error while sending to JabRef" when the browser extension interacts with JabRef. [JabRef-Browser-Extension#479](https://github.com/JabRef/JabRef-Browser-Extension/issues/479)

### Removed

Expand Down
6 changes: 4 additions & 2 deletions buildres/windows/JabRefHost.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@
pushd %~dp0

:: Test if pwsh exists
setlocal enabledelayedexpansion
where /q pwsh.exe
if %errorlevel%==0 (
if !ERRORLEVEL!==0 (
@pwsh.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -File ".\JabRefHost.ps1"
) else (
:: If not, test if powershell exists
where /q powershell.exe
if %errorlevel%==0 (
if !ERRORLEVEL!==0 (
@powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -File ".\JabRefHost.ps1"
) else (
echo "Could not find pwsh.exe or powershell.exe" 1>&2
echo "Please install PowerShell and try again." 1>&2
exit /b 1
)
)
endlocal

0 comments on commit 2a82b9a

Please sign in to comment.