mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
make -V/--version fast on *nix
This commit is contained in:
parent
a6db0c9d54
commit
3c7e62786c
2 changed files with 15 additions and 2 deletions
|
@ -46,4 +46,11 @@ fi
|
||||||
. "$(cd `dirname $SOURCEPATH`/..; pwd)/bin/logstash.lib.sh"
|
. "$(cd `dirname $SOURCEPATH`/..; pwd)/bin/logstash.lib.sh"
|
||||||
setup
|
setup
|
||||||
|
|
||||||
ruby_exec "${LOGSTASH_HOME}/lib/bootstrap/environment.rb" "logstash/runner.rb" "$@"
|
if [ "$1" = "-V" ] || [ "$1" = "--version" ];
|
||||||
|
then
|
||||||
|
LOGSTASH_VERSION_FILE="${LOGSTASH_HOME}/logstash-core/lib/logstash/version.rb"
|
||||||
|
LOGSTASH_VERSION="$(sed -ne 's/^LOGSTASH_VERSION = "\([^*]*\)"$/\1/p' $LOGSTASH_VERSION_FILE)"
|
||||||
|
echo "logstash $LOGSTASH_VERSION"
|
||||||
|
else
|
||||||
|
ruby_exec "${LOGSTASH_HOME}/lib/bootstrap/environment.rb" "logstash/runner.rb" "$@"
|
||||||
|
fi
|
||||||
|
|
|
@ -14,9 +14,15 @@ shared_examples "logstash version" do |logstash|
|
||||||
|
|
||||||
context "on #{logstash.hostname}" do
|
context "on #{logstash.hostname}" do
|
||||||
it "returns the right logstash version" do
|
it "returns the right logstash version" do
|
||||||
result = logstash.run_command_in_path("bin/logstash --path.settings=/etc/logstash --version")
|
result = logstash.run_command_in_path("bin/logstash --version")
|
||||||
expect(result).to run_successfully_and_output(/#{LOGSTASH_VERSION}/)
|
expect(result).to run_successfully_and_output(/#{LOGSTASH_VERSION}/)
|
||||||
end
|
end
|
||||||
|
context "when also using the --path.settings argument" do
|
||||||
|
it "returns the right logstash version" do
|
||||||
|
result = logstash.run_command_in_path("bin/logstash --path.settings=/etc/logstash --version")
|
||||||
|
expect(result).to run_successfully_and_output(/#{LOGSTASH_VERSION}/)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue