Created
September 1, 2008 16:01
-
-
Save ckozus/8313 to your computer and use it in GitHub Desktop.
tar wrapper script for windows using 7zip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @call ruby r:\tar.rb %* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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