Skip to content

Commit

Permalink
display correct path of created files
Browse files Browse the repository at this point in the history
Fixes #5355
  • Loading branch information
wiibaa authored and suyograo committed May 24, 2016
1 parent 0665497 commit 9c4bac7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/pluginmanager/generate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
require "erb"
require "ostruct"
require "fileutils"
require "pathname"

class LogStash::PluginManager::Generate < LogStash::PluginManager::Command

Expand All @@ -19,12 +20,12 @@ class LogStash::PluginManager::Generate < LogStash::PluginManager::Command

def execute
source = File.join(File.dirname(__FILE__), "templates", "#{type}-plugin")
target_path = File.join(path, full_plugin_name)
FileUtils.mkdir(target_path)
puts " Creating #{target_path}"
@target_path = File.join(path, full_plugin_name)
FileUtils.mkdir(@target_path)
puts " Creating #{@target_path}"

begin
create_scaffold(source, target_path)
create_scaffold(source, @target_path)
rescue Errno::EACCES => exception
report_exception("Permission denied when executing the plugin manager", exception)
rescue => exception
Expand Down Expand Up @@ -55,7 +56,7 @@ def transform_r(source, target)
else
FileUtils.cp(source_entry, target_entry)
end
puts "\t create #{File.join(full_plugin_name, File.basename(target_entry))}"
puts "\t create #{File.join(full_plugin_name, Pathname.new(target_entry).relative_path_from(Pathname.new(@target_path)))}"
end
end
end
Expand Down

0 comments on commit 9c4bac7

Please sign in to comment.