This repository was archived by the owner on Dec 4, 2017. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ function cacheRefresh() {
4242 if [[ -e $srcPath ]]; then
4343 [[ -d " $destDir " ]] || (set -x; mkdir $destDir );
4444 case " $f " in
45- ($FILE_PATTERN )
45+ (* $FILE_PATTERN * )
4646 (set -x; cp $srcPath $destPath );;
4747 (* )
4848 echo " SKIPPED $f " ;;
@@ -56,11 +56,20 @@ function cacheRefresh() {
5656 [[ $allFound ]] || exit 1;
5757}
5858
59- function cacheDiff () {
59+ function cacheDiffSummary () {
6060 diff -qr -x " _*.*" " $CACHE /" " $LATEST /" | \
6161 grep -v " ^Only in"
6262}
6363
64+ function cacheDiff() {
65+ local FILES=" *$1 *"
66+ cd $CACHE ;
67+ # List files
68+ find . -name " $FILES " ! -name " *~" -exec diff -q {} ../latest/{} \;
69+ # Show differences
70+ find . -name " $FILES " ! -name " *~" -exec diff {} ../latest/{} \;
71+ }
72+
6473function usage() {
6574 echo " Usage: cache.sh [-d | -l | -r pattern]"
6675 echo " -d diff cache and latest subdirectories"
@@ -69,8 +78,9 @@ function usage() {
6978}
7079
7180case " $1 " in
72- (-r) shift ; cacheRefresh $@ ;;
73- (-d) shift ; cacheDiff $@ ;;
74- (-l) shift ; printf " $FILES \n\n" ;;
75- (* ) usage;
81+ (-r|--refresh) shift ; cacheRefresh $@ ;;
82+ (-ds|--diff-summary) shift ; cacheDiffSummary $@ ;;
83+ (-d|--diff) shift ; cacheDiff $@ ;;
84+ (-l) shift ; printf " $FILES \n\n" ;;
85+ (* ) usage;
7686esac
You can’t perform that action at this time.
0 commit comments