-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.sh
executable file
·51 lines (35 loc) · 1.23 KB
/
test.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
#!/bin/bash
REPOS='nolanlawson/tiny-queue lodash/lodash substack/node-browserify strongloop/express facebook/react gulpjs/gulp pouchdb/pouchdb'
RESULTS_FILE=$(pwd)/results.md
timeIt() { { time npm install > /dev/null 2>&1 ; } 2>&1 | grep real | awk '{print $2}' ; }
rm -fr $RESULTS_FILE workspace
touch $RESULTS_FILE
npm cache clean
for repo in $REPOS; do
echo "# $repo" >> $RESULTS_FILE
git clone --single-branch -b master --depth 1 https://github.com/$repo workspace
cd workspace
echo "## local-npm" >> $RESULTS_FILE
npm set registry http://127.0.0.1:5080
rm -fr node_modules
echo "* 1st npm install: $(timeIt)" >> $RESULTS_FILE
rm -fr node_modules
echo "* 2nd npm install: $(timeIt)" >> $RESULTS_FILE
rm -fr node_modules
npm cache clean
echo "* After cache clean: $(timeIt)" >> $RESULTS_FILE
echo "## Regular npm" >> $RESULTS_FILE
npm set registry https://registry.npmjs.org
rm -fr node_modules
echo "* 1st npm install: $(timeIt)" >> $RESULTS_FILE
rm -fr node_modules
echo "* 2nd npm install: $(timeIt)" >> $RESULTS_FILE
rm -fr node_modules
npm cache clean
echo "* After cache clean: $(timeIt)" >> $RESULTS_FILE
cd ..
# clean up
rm -fr workspace
done
cat $RESULTS_FILE
python print-summary.py