# -------------- logic # if not exists #{installDir}, create it if not File.exists? installDir print "create directory: #{installDir}" Dir.mkdir installDir end
if File.exists? ( installDir + "firefox" ) msg = "install directory is already exists. continue installing ? [y/n]: " input = "" while not (input == "y" || input == "n") print msg; input = gets.chomp end if input == "n" exit end end
puts "Downloading #{url}... this may take a few minite" system "wget --directory-prefix=/tmp/ #{url}" puts puts "Extracting #{base}..."
system "cd /tmp/ && gunzip #{base} && tar xf #{base[0..-4]} && cp -r firefox #{installDir}" puts "cd #{installDir} && gunzip #{base} && tar xf #{base[0..-4]}"
puts "#########################" puts "firefox is now installed." puts "#########################"
puts "Type '#{installDir}firefox/firefox' to execute" puts "Adding '#{installDir}firefox/' to $PATH is reccomend."