Permalink
Browse files

Make binary installer play nice with sources that have spaces in file…

…name
  • Loading branch information...
1 parent aa8d5c1 commit 02e059d1998935da612f1deb06612f680b572c11 @tmikoss tmikoss committed Nov 11, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/sprinkle/installers/binary.rb
@@ -24,10 +24,14 @@ def prepare_commands #:nodoc:
def install_commands #:nodoc:
commands = [ "bash -c 'wget -cq --directory-prefix=#{@options[:archives].first} #{@binary_archive}'" ]
- commands << "bash -c 'cd #{@options[:prefix].first} && #{extract_command} #{@options[:archives].first}/#{@binary_archive.split("/").last}'"
+ commands << "bash -c \"cd #{@options[:prefix].first} && #{extract_command} '#{@options[:archives].first}/#{archive_name}'\""
end
- def extract_command(archive_name = @binary_archive.split("/").last)
+ def archive_name
+ @archive_name ||= @binary_archive.split("/").last.gsub('%20', ' ')
+ end
+
+ def extract_command
case archive_name
when /(tar.gz)|(tgz)$/
'tar xzf'

0 comments on commit 02e059d

Please sign in to comment.