From 50c4f58276fa9da6d06a53af6b2e30e3877a33d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 24 May 2016 12:56:31 +0200 Subject: [PATCH] SOLR-9151: Fix SolrCLI so that bin/solr -e cloud example can be run from any CWD --- solr/CHANGES.txt | 2 ++ solr/core/src/java/org/apache/solr/util/SolrCLI.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index f52dc9bdaf8..437c48cebff 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -234,6 +234,8 @@ Bug Fixes * SOLR-9134: Fix RestManager.addManagedResource return value. (Christine Poerschke) +* SOLR-9151: Fix SolrCLI so that bin/solr -e cloud example can be run from any CWD (janhoy) + Optimizations ---------------------- * SOLR-8722: Don't force a full ZkStateReader refresh on every Overseer operation. diff --git a/solr/core/src/java/org/apache/solr/util/SolrCLI.java b/solr/core/src/java/org/apache/solr/util/SolrCLI.java index 13274847157..9bc986b1c01 100644 --- a/solr/core/src/java/org/apache/solr/util/SolrCLI.java +++ b/solr/core/src/java/org/apache/solr/util/SolrCLI.java @@ -2493,7 +2493,7 @@ public class SolrCLI { String solrHome = solrHomeDir.getAbsolutePath(); // don't display a huge path for solr home if it is relative to the cwd - if (!isWindows && solrHome.startsWith(cwdPath)) + if (!isWindows && cwdPath.length() > 1 && solrHome.startsWith(cwdPath)) solrHome = solrHome.substring(cwdPath.length()+1); String startCmd =