forked from prebid/prebid-js-build-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkout.sh
executable file
·47 lines (41 loc) · 1.04 KB
/
checkout.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
#!/bin/bash
NUMBER_OF_PREVIOUS_VERSIONS="$1"
if [ $NUMBER_OF_PREVIOUS_VERSIONS -gt 0 ]; then
echo "checking out $NUMBER_OF_PREVIOUS_VERSIONS previous versions of prebid.js"
else
NUMBER_OF_PREVIOUS_VERSIONS=2
echo "checking out $NUMBER_OF_PREVIOUS_VERSIONS previous versions of prebid.js"
fi
PREBID_DIR="prebid.js"
if [ ! -d "$PREBID_DIR" ]
then
mkdir $PREBID_DIR
cd $PREBID_DIR
else
cd $PREBID_DIR
fi
if [ ! -d working_master ]
then
git clone https://github.com/prebid/Prebid.js.git working_master
cd working_master
else
cd working_master
fi
git pull
for TAG in `git tag --sort=-creatordate | head -n $NUMBER_OF_PREVIOUS_VERSIONS`
do
DIR_NAME="../prebid_${TAG}"
if [ -d "$DIR_NAME" ]
then
echo "$DIR_NAME already installed"
else
echo "Copying working_master to $DIR_NAME"
cp -R ../working_master $DIR_NAME
cd $DIR_NAME
git checkout ${TAG}
npm install
gulp build
echo "$DIR_NAME installed"
fi
done
echo "update complete"