This repository was archived by the owner on Dec 4, 2017. It is now read-only.
File tree 1 file changed +16
-6
lines changed
1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ function cacheRefresh() {
42
42
if [[ -e $srcPath ]]; then
43
43
[[ -d " $destDir " ]] || (set -x; mkdir $destDir );
44
44
case " $f " in
45
- ($FILE_PATTERN )
45
+ (* $FILE_PATTERN * )
46
46
(set -x; cp $srcPath $destPath );;
47
47
(* )
48
48
echo " SKIPPED $f " ;;
@@ -56,11 +56,20 @@ function cacheRefresh() {
56
56
[[ $allFound ]] || exit 1;
57
57
}
58
58
59
- function cacheDiff () {
59
+ function cacheDiffSummary () {
60
60
diff -qr -x " _*.*" " $CACHE /" " $LATEST /" | \
61
61
grep -v " ^Only in"
62
62
}
63
63
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
+
64
73
function usage() {
65
74
echo " Usage: cache.sh [-d | -l | -r pattern]"
66
75
echo " -d diff cache and latest subdirectories"
@@ -69,8 +78,9 @@ function usage() {
69
78
}
70
79
71
80
case " $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;
76
86
esac
You can’t perform that action at this time.
0 commit comments