Permalink
Browse files

Escape path/file names so the compile command works when spaces are p…

…resent in them.

Signed-off-by: Alan Harper <alan@aussiegeek.net>
  • Loading branch information...
1 parent 1c0b529 commit 2d99ab563f607a29fcd0cb6c5d7b2c05c15585d7 @things things committed with aussiegeek Jul 7, 2009
Showing with 7 additions and 3 deletions.
  1. +7 −3 Support/lib/sass_engine.rb
View
@@ -13,11 +13,15 @@ def execute!
private
def compile!
command = options.empty? ? "cat" : "tail -n +2"
- Kernel.system("#{command} #{@filename} | sass #{flags} -s > #{output_filename}")
+ Kernel.system("#{command} #{escape(@filename)} | sass #{flags} -s > #{escape(output_filename)}")
end
- def preview!
- Kernel.system("open -g #{preview_filename}") if process_status.exitstatus.zero? && preview_filename
+ def preview!
+ Kernel.system("open -g #{escape(preview_filename)}") if process_status.exitstatus.zero? && preview_filename
+ end
+
+ def escape(s)
+ "\"#{s.gsub('"', '\"')}\""
end
def process_status

0 comments on commit 2d99ab5

Please sign in to comment.