Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to run the bin/logstash-plugin install <pack> outside of the logstash directory #6602

Conversation

ph
Copy link
Contributor

@ph ph commented Jan 27, 2017

Allow to run the bin/logstash-plugin install outside of the logstash directory
Fixes: #6599

@ph ph requested a review from suyograo January 27, 2017 21:33
@ph ph changed the title Allow to run the bin/logstash-plugin install <pack> outside of the Allow to run the bin/logstash-plugin install <pack> outside of the logstash directory Jan 27, 2017

# Some of the internal classes requires to be inside the LOGSTASH_HOME to find the relative
# path of the core gems.
Dir.chdir(LogStash::Environment::LOGSTASH_HOME) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this undo the chdir after it's done?

Copy link
Contributor Author

@ph ph Jan 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes its a block, it will return to the original directory:

puts "current dir: #{Dir.pwd}"

Dir.chdir("/Users/ph") do
  puts "current dir: #{Dir.pwd}"
end
puts "current dir: #{Dir.pwd}"
⚙ph@sashimi/tmp ruby testing.rb
current dir: /private/tmp
current dir: /Users/ph
current dir: /private/tmp
⚙ph@sashimi/tmp

Copy link
Contributor

@suyograo suyograo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify if chdir will be reverted to PWD, once the install is complete?

@suyograo
Copy link
Contributor

LGTM

@elasticsearch-bot
Copy link

Pier-Hugues Pellerin merged this into the following branches!

Branch Commits
master b3906c8
5.x 2e908a0

elasticsearch-bot pushed a commit that referenced this pull request Jan 31, 2017
@suyograo
Copy link
Contributor

@ph this needs to go to 5.2 as well

@elasticsearch-bot
Copy link

Pier-Hugues Pellerin merged this into the following branches!

Branch Commits
5.2 034b15d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants