File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed
Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change 11# Function to extract archives with different extensions.
22export def extract [name :string ] {
33 let handlers = [ [extension command ];
4- [' tar\.bz2|tbz|tbz2' ' tar xvjf' ]
5- [' tar\.gz|tgz' ' tar xvzf' ]
6- [' tar\.xz|txz' ' tar xvf' ]
7- [' tar\.Z' ' tar xvZf' ]
8- [' bz2' ' bunzip2' ]
9- [' deb' ' ar x' ]
10- [' gz' ' gunzip' ]
11- [' pkg' ' pkgutil --expand' ]
12- [' rar' ' unrar x' ]
13- [' tar' ' tar xvf' ]
14- [' xz' ' xz --decompress' ]
15- [' zip|war|jar|nupkg' ' unzip' ]
16- [' Z' ' uncompress' ]
17- [' 7z' ' 7za x' ]
4+ [' tar\.bz2|tbz|tbz2' ' tar xvjf' ]
5+ [' tar\.gz|tgz' ' tar xvzf' ]
6+ [' tar\.xz|txz' ' tar xvf' ]
7+ [' tar\.Z' ' tar xvZf' ]
8+ [' bz2' ' bunzip2' ]
9+ [' deb' ' ar x' ]
10+ [' gz' ' gunzip' ]
11+ [' pkg' ' pkgutil --expand' ]
12+ [' rar' ' unrar x' ]
13+ [' tar' ' tar xvf' ]
14+ [' xz' ' xz --decompress' ]
15+ [' zip|war|jar|nupkg|exe ' ' unzip' ]
16+ [' Z' ' uncompress' ]
17+ [' 7z' ' 7za x' ]
1818 ]
1919 let maybe_handler = ($handlers | where $name =~ $' \.(($it.extension ))$' )
2020 if ($maybe_handler | is-empty ) {
You can’t perform that action at this time.
0 commit comments