Advertisement
WhiteFire_Sondergaar

UpdateLWJGL.rb

Jun 3rd, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.65 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3. require 'fileutils'
  4.  
  5. lwjgl = File.expand_path(ARGV[0])
  6. update = File.expand_path(ARGV[1])
  7.  
  8. if !File.directory?(lwjgl) || !File.directory?(update)
  9.   abort("updatelwjgl.rb [FTB_Mod_Pack] [lwjgl]")
  10. end
  11.  
  12. have = Dir.glob([
  13.     "#{lwjgl}/jar/*.jar",
  14.     "#{lwjgl}/native/linux/*.so",
  15.     "#{lwjgl}/native/windows/*.dll"
  16.   ])
  17.  
  18. replace = Dir.glob([
  19.     "#{update}/minecraft/bin/*.jar",
  20.     "#{update}/minecraft/bin/*.{so,dll}",
  21.     "#{update}/minecraft/bin/natives/*.{so,dll}"
  22.   ])
  23.  
  24. replace.each { |f|
  25.   n = have.find { |h| File.basename(h) == File.basename(f) }
  26.   if n
  27.     puts "#{n} -> #{f}"
  28.     FileUtils.cp(n, f)
  29.   end
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement