Sha256: 5c5d2b168e9092ee49be1e4ab0f0bfa6677feec8b5f5c59acef5562f90849b9e
Contents?: true
Size: 1.14 KB
Versions: 13
Compression:
Stored size: 1.14 KB
Contents
module MagLove module Command class Compress include Commander::Methods def run task :theme, theme: "!" do |args, options| # archive_path("dist/themes/#{options.theme}", "**/*", "#{options.theme}.tar.gz") target = "themes/#{options.theme}/#{options.theme}.tar.gz" Dir.chdir("dist") do tgz = Zlib::GzipWriter.new(File.open(target, "wb")) Archive::Tar::Minitar::Output.open(tgz) do |tar| Dir["themes/#{options.theme}/**/*"].reject{|file| file == target}.each do |file| Archive::Tar::Minitar::pack_file(file, tar) end end end # Dir.chdir(path) do # tgz = Zlib::GzipWriter.new(File.open(target, 'wb')) # Archive::Tar::Minitar::Output.open(tgz) do |tar| # Dir[pattern].reject{|file| file == target}.each do |file| # Archive::Tar::Minitar::pack_file(file, tar) # end # end # end debug("▸ created #{options.theme}.tar.gz") end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems