浏览代码

Fix SonarService.bat for supporting folders with names including spaces

When %REALPATH% had a folder with whitespaces, e.g. c:\program files\sonarqube, it showed a nasty powershell error
tags/9.7.0.61563
Jose C 1年前
父节点
当前提交
525f26c2c9
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      sonar-application/src/main/assembly/bin/windows-x86-64/SonarService.bat

+ 1
- 1
sonar-application/src/main/assembly/bin/windows-x86-64/SonarService.bat 查看文件

@@ -26,7 +26,7 @@ rem check if Java is found
set JAVA_EXE=
call "%REALPATH%lib\find_java.bat" set_java_exe FAIL || goto:eof
rem replace JAVA_EXE with the Java path in configuration file
powershell -Command "(Get-Content %REALPATH%lib\SonarServiceWrapperTemplate.xml) -replace 'JAVA_EXE', '%JAVA_EXE%' | Out-File -encoding ASCII %REALPATH%lib\SonarServiceWrapper.xml"
powershell -Command "(Get-Content '%REALPATH%lib\SonarServiceWrapperTemplate.xml') -replace 'JAVA_EXE', '%JAVA_EXE%' | Out-File -encoding ASCII '%REALPATH%lib\SonarServiceWrapper.xml'"

rem call the SonarServiceWrapper.exe passing all the parameters
"%REALPATH%lib\SonarServiceWrapper.exe" %*

正在加载...
取消
保存