Selaa lähdekoodia

Fix starting on Windows from another drive (#29086)

The cd command on Windows has an oddity regarding changing
directories. If the drive of the current directory is a different drive
than than of the directory that was passed to the cd command, cd acts in
query mode and does not change the current directory. Instead, a flag is
needed to put the cd command into set mode so that the directory
actually changes. This causes a problem when starting Elasticsearch from
a directory different than the one where it is installed and this commit
fixes the issue.
Martijn Laarman 7 vuotta sitten
vanhempi
commit
42c7c75298
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      distribution/src/bin/elasticsearch.bat

+ 1 - 1
distribution/src/bin/elasticsearch.bat

@@ -50,7 +50,7 @@ if "%MAYBE_JVM_OPTIONS_PARSER_FAILED%" == "jvm_options_parser_failed" (
   exit /b 1
 )
 
-cd "%ES_HOME%"
+cd /d "%ES_HOME%"
 %JAVA% %ES_JAVA_OPTS% -Delasticsearch -Des.path.home="%ES_HOME%" -Des.path.conf="%ES_PATH_CONF%" -cp "%ES_CLASSPATH%" "org.elasticsearch.bootstrap.Elasticsearch" !newparams!
 
 endlocal