cmder/pack.rb

40 lines
884 B
Ruby
Raw Normal View History

2013-12-10 01:17:35 +08:00
# Samuel Vasko 2013
# Cmder packing script -- Creates zip files for relase
require "fileutils"
def create_archive name, exclude
if exclude
2013-12-10 01:48:30 +08:00
exclude = " -x!cmder\\" + exclude
2013-12-10 01:17:35 +08:00
else
exclude = ""
end
2013-12-10 01:48:30 +08:00
system('ls')
2013-12-10 01:17:35 +08:00
puts "Running 7z a -x@cmder\\packignore" + exclude + " " + name + " cmder"
2013-12-10 01:48:30 +08:00
system("7z a -x@cmder\\packignore" + exclude + " " + name + " cmder")
2013-12-10 01:17:35 +08:00
end
targets = [
["cmder.zip"],
["cmder.7z"],
["cmder_mini.zip", "vendor\\msysgit"]
]
unless system("git describe --abbrev=0 --tags")
puts "Failied to get the last tag from git, looks like something is missing"
end
version = `git describe --abbrev=0 --tags`
2013-12-10 01:48:30 +08:00
2013-12-10 01:52:04 +08:00
FileUtils.touch('Version ' + version.chomp)
2013-12-10 01:48:30 +08:00
FileUtils.rm('config/.history')
Dir.chdir('..')
2013-12-10 01:17:35 +08:00
targets.each do |ar|
create_archive ar[0], ar[1]
end
2013-12-10 01:48:30 +08:00
Dir.chdir('cmder')
2013-12-10 01:17:35 +08:00
2013-12-10 01:48:30 +08:00
FileUtils.rm('Version ' + version.chomp)