Advertisement
swarley

CoggleCraft.rb

Nov 24th, 2011
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.45 KB | None | 0 0
  1. #Cogglecraft main
  2.  
  3. require_relative "lib/download"
  4. require_relative "lib/mkdir"
  5. require_relative "lib/things"
  6. require_relative "lib/get_platform_natives"
  7. require_relative "lib/has_installed"
  8.  
  9. begin
  10.   Coggle.mkdir($dirs)
  11.   $files.each do |file|
  12.     Coggle.download(file, 'tmp/')
  13.   end
  14.  
  15.   Coggle.get_platform_natives
  16.  
  17.   if $platform == 'windows'
  18.     Coggle.download('dl.dropbox.com/u/24529/CoggleClient/bspatch.exe', 'tmp/')
  19.   else
  20.     if Coggle.has_installed? "bspatch"
  21.       0
  22.     else
  23.       puts "Please install bspatch and try again. Or, add the executable to a folder in your path."
  24.       1.upcase # <-- LoL producing an exception error so I dont have to rewrite the `rm` s
  25.     end
  26.   end
  27.  
  28.   Thread.new do Coggle.download('dl.dropbox.com/u/24529/CoggleClient/patch-1.8.1.zip', 'tmp/') end
  29.   Coggle.download('dev.bukkit.org/media/files/552/170/spoutcraft-dev-SNAPSHOT.zip', 'tmp/', 'spoutcraft.zip')
  30.   Thread.new do Coggle.download('dl.dropbox.com/u/24529/CoggleClient/version', 'etc/') end
  31.   if $platform == 'linux'
  32.     if Coggle.has_installed? "unlzma"
  33.       `cd tmp; unlzma linux_natives.jar.lzma`
  34.     else
  35.       puts "Please install lzma and try again. Or, add the unlzma executable to a folder in your path."
  36.       1.upcase # <--- LoL another error
  37.     end
  38.   elsif $platform == "windows"
  39.     #blah
  40.   end
  41. rescue Exception => e
  42.   `rm -rf ./etc`
  43.   `rm -rf ./tmp`
  44.   `rm -rf ./bin`
  45.   puts e.backtrace
  46.   puts "Failed to install client."
  47. end
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement