chore(cache.sh): cleanup options and usage (#2221)
* chore(cache.sh): cleanup options and usage * add cd to project root
This commit is contained in:
parent
a24800aed7
commit
eb76eaaa8b
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
set -e -o pipefail
|
set -e -o pipefail
|
||||||
|
|
||||||
|
cd `dirname $0`/..
|
||||||
|
|
||||||
BASE="public/docs/ts"
|
BASE="public/docs/ts"
|
||||||
LATEST="$BASE/latest"
|
LATEST="$BASE/latest"
|
||||||
CACHE="$BASE/_cache"
|
CACHE="$BASE/_cache"
|
||||||
|
@ -71,16 +73,17 @@ function cacheDiff() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function usage() {
|
function usage() {
|
||||||
echo "Usage: cache.sh [-d | -l | -r pattern]"
|
echo "Usage: cache.sh [options]"
|
||||||
echo " -d diff cache and latest subdirectories"
|
echo " (-ds|--diff-summary) list names of cache files that differ from ts/latest"
|
||||||
echo " -l list files subject to caching"
|
echo " (-d|--diff) pat diff cache and latest subdirectories"
|
||||||
echo " -r pat refresh files in cache matching pattern"
|
echo " (-l|--list) list files subject to caching"
|
||||||
|
echo " (-r|--refresh) pat refresh files in cache matching pattern"
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
(-r|--refresh) shift; cacheRefresh $@;;
|
|
||||||
(-ds|--diff-summary) shift; cacheDiffSummary $@;;
|
(-ds|--diff-summary) shift; cacheDiffSummary $@;;
|
||||||
(-d|--diff) shift; cacheDiff $@;;
|
(-d|--diff) shift; cacheDiff $@;;
|
||||||
(-l) shift; printf "$FILES\n\n";;
|
(-l|--list) shift; printf "$FILES\n\n";;
|
||||||
|
(-r|--refresh) shift; cacheRefresh $@;;
|
||||||
(*) usage;
|
(*) usage;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in New Issue