Commit b34edd4d authored by Laurent Briais's avatar Laurent Briais

Now changing directory to generated files directory before post-actions

parent 07163b72
Pipeline #94409147 passed with stage
in 1 minute and 7 seconds
......@@ -95,8 +95,11 @@ module PowerStencil
def build_entity(entity_to_build, target_path)
initial_directory = Dir.pwd
target_plugin_name = entity_to_build.buildable_by.to_s
default_build entity_to_build, target_path
# Post processing executed from generated directory (#11)
Dir.chdir target_path
if target_plugin_name.empty?
post_build_hook entity_to_build, target_path
......@@ -106,6 +109,8 @@ module PowerStencil
raise PowerStencil::Error, "Plugin '#{target_plugin_name}' has no build capability !" unless target_plugin.capabilities[:build]
target_plugin.post_build_hook entity_to_build, target_path
end
ensure
Dir.chdir initial_directory
end
def default_build(entity_to_build, target_path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment