From f7fc041034620c9fb06f39aeaa68571cafd497b5 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Mon, 20 Aug 2012 19:28:43 -0700 Subject: [PATCH] Check whether a Pathname exists before calling realpath in build. Closes #569 --- middleman-core/lib/middleman-core/cli/build.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/middleman-core/lib/middleman-core/cli/build.rb b/middleman-core/lib/middleman-core/cli/build.rb index 5699a763..2d9e0ded 100644 --- a/middleman-core/lib/middleman-core/cli/build.rb +++ b/middleman-core/lib/middleman-core/cli/build.rb @@ -259,7 +259,10 @@ module Middleman::Cli output_path = base.render_to_file(resource) - @cleaning_queue.delete(Pathname.new(output_path).realpath) if cleaning? + if cleaning? + pn = Pathname(output_path) + @cleaning_queue.delete(pn.realpath) if pn.exist? + end end ::Middleman::Profiling.report("build")