lib/slugbuilder/builder.rb in slugbuilder-1.2.0 vs lib/slugbuilder/builder.rb in slugbuilder-1.3.0

- old
+ new

@@ -86,11 +86,13 @@ def build_and_release @build_time = realtime do set_environment buildpacks = fetch_buildpacks + run_hook('pre-compile') run_buildpacks(buildpacks) + run_hook('post-compile') @slug_time = realtime { build_slug } slug_size print_workers end end @@ -187,9 +189,16 @@ end end end @buildpacks + end + + def run_hook(hook_name) + Dir.chdir(@build_dir) do + script = "#{@build_dir}/bin/#{hook_name}" + run(script) if File.exists?(script) + end end def run_buildpacks(buildpacks) @compile_time = 0