1 |
9015
|
aaronmk
|
#!/bin/bash -e
|
2 |
|
|
. "$(dirname "${BASH_SOURCE[0]}")"/util.sh
|
3 |
|
|
|
4 |
|
|
if self_not_included; then
|
5 |
|
|
|
6 |
|
|
### zip
|
7 |
|
|
|
8 |
9074
|
aaronmk
|
zip()
|
9 |
9015
|
aaronmk
|
{
|
10 |
9194
|
aaronmk
|
limit_stdout=1 try self "$@"
|
11 |
9015
|
aaronmk
|
ignore 12 # "zip has nothing to do" (`man zip`)
|
12 |
|
|
end_try
|
13 |
|
|
}
|
14 |
|
|
|
15 |
9194
|
aaronmk
|
unzip() { limit_stdout=1 self "$@"; }
|
16 |
9015
|
aaronmk
|
|
17 |
|
|
set_inv force
|
18 |
|
|
alias zip_newer='zip ${no_force:+-u }'
|
19 |
|
|
alias unzip_newer='unzip ${no_force:+-u }-o'
|
20 |
|
|
# -o is safe because -u only extracts newer files
|
21 |
|
|
|
22 |
|
|
fi
|