Skip to content

Instantly share code, notes, and snippets.

@ckozus
Created September 1, 2008 16:01
Show Gist options
  • Save ckozus/8313 to your computer and use it in GitHub Desktop.
Save ckozus/8313 to your computer and use it in GitHub Desktop.
tar wrapper script for windows using 7zip
@call ruby r:\tar.rb %*
params = ARGV.shift
dest = ARGV.shift
orig = ARGV.shift
if params && params.split(//).sort.join == 'cfz'
if dest && orig
if dest =~ /(.*)\.tar\.gz$/
#FIXME: Check errorlevel after the first execution
system "7z a -y -ttar #{$1}.tar #{orig}"
system "7z a -y -tgzip #{$1}.tar.gz #{$1}.tar"
else
puts "This only works when the dest file has a .tar.gz extension."
end
else
puts "dest && orign should be specified."
end
else
puts "Only 'czf' parameter is supported"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment