5 ROOT_DIR
="$( cd "$
( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
8 if [[ -x $
(which md5
) ]]; then
11 md5sum $1 |cut
-d\
-f1
15 for i
in $
(find $ROOT_DIR/public-processed
/js
-maxdepth 1 -name '*.js' ! -name '*.min.js'); do
16 min_file
=${i%.js}.min.js
18 md5_checksum
=$
(generate_md5
$i)
21 # A little bit of debugging
23 if [[ ! -f $md5_file ]]; then
24 echo "$i: $md5_file does not exist" >&2
26 if [[ ! -f $min_file ]]; then
27 echo "$i: $min_file does not exist" >&2
29 if [[ $md5_checksum != $
(cat $md5_file) ]]; then
30 echo "$i Checksum mismatch $md5_checksum != $(cat $md5_file)" >&2
35 if [[ ! -f $md5_file ]] ||
[[ ! -f $min_file ]] ||
[[ $md5_checksum != $
(cat $md5_file) ]]; then
36 echo $i needs updating
>&2
38 rm -f $min_file ${min_file}.gz ${min_file}.map ${min_file}.map.gz
39 nice grunt manglejs
--module $
(basename $i) # & disabling async
40 echo $md5_checksum > $md5_file
42 echo "$i is compiled" >&2
48 for i
in $
(find $ROOT_DIR/public-processed
/js
-name '*.js' ! -name '*.min.js'); do
49 min_file
=${i%.js}.min.js
50 if [[ ! -f $min_file ]]; then
51 echo Missing
$min_file >&2