1
0
mirror of https://github.com/fspc/BikeShed-1.git synced 2025-04-04 05:33:22 -04:00
BikeShed-1/install_extjs.rb
Jason Denney 4fe8865aca Dockerize! Startup with docker-compose up
Make sure to docker-compose build first
2016-02-25 13:36:01 -08:00

21 lines
698 B
Ruby
Executable File

#!/usr/bin/env ruby
require 'fileutils'
extjs_url = "http://my.jasondenney.com/extjs-4.1.1.zip"
download_dir = '/tmp'
dest_dir ='/usr/lib'
extjs_download_path = File.join(download_dir,'extjs-4.1.1.zip')
files = Dir.glob(File.join(dest_dir, 'extjs', '*'))
if files.empty? and Dir.glob(extjs_download_path).empty?
`wget -P #{download_dir} #{extjs_url}`
raise "Failed downloading #{extjs_url}" if Dir.glob(extjs_download_path).empty?
end
if files.empty?
puts `unzip #{extjs_download_path} -d #{dest_dir}/`
FileUtils.mv(File.join(dest_dir, 'ext-4.1.1a'), File.join(dest_dir, 'extjs'))
end
raise "Failed unzipping #{extjs_download_path}" if Dir.glob(File.join(dest_dir,'extjs', '*')).empty?