-
Notifications
You must be signed in to change notification settings - Fork 322
/
update.sh
executable file
·64 lines (48 loc) · 1.32 KB
/
update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
ORIGWD=$PWD
TMPDIR=/tmp/plato
CMD=$PWD/bin/plato
echo Original directory : $ORIGWD
echo Temporary root directory : $TMPDIR
echo Command : $CMD
unset REFETCH
if [ $1 ]
then
REFETCH=true
fi
if [ -d examples ]
then
rm -rf examples
fi
if [ $REFETCH ]
then
if [ -d $TMPDIR ]
then
echo "Removing $TMPDIR"
rm -rf $TMPDIR
fi
git clone git://github.com/jquery/jquery.git $TMPDIR/jquery
git clone git://github.com/gruntjs/grunt.git $TMPDIR/grunt
git clone https://github.com/marionettejs/backbone.marionette.git $TMPDIR/marionette
fi
function runCommand() {
echo $1
$1
}
for DAYS_AGO in 60 30 20 10 0; do
DATE=$(date -j -f "%a %b %d %T %Z %Y" "`date -v -${DAYS_AGO}d`" "+%s")
echo Using date $DATE / $(date -j -f "%s" "$DATE" "+%a %b %d %T %Z %Y")
cd $TMPDIR/jquery &&
echo In $PWD &&
git co -f $(git rev-list -n 1 --before="$DATE" master) &&
runCommand "$CMD -D $DATE -r -d $ORIGWD/examples/jquery -x 'exports.js|tro.js' src";
cd $TMPDIR/marionette &&
echo In $PWD &&
git co -f $(git rev-list -n 1 --before="$DATE" master) &&
runCommand "$CMD -D $DATE -d $ORIGWD/examples/marionette src/*.js";
cd $TMPDIR/grunt &&
echo In $PWD &&
git co -f $(git rev-list -n 1 --before="$DATE" master) &&
runCommand "$CMD -D $DATE -r -d $ORIGWD/examples/grunt lib";
done
cd $ORIGWD