Skip to content

Commit

Permalink
Improve size.sh to accept arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
lifesinger committed Jun 24, 2013
1 parent fd2799c commit 28d4338
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -22,4 +22,4 @@ totoro:
@totoro --adapter=tests/totoro-adapter.js

size:
@tools/size.sh
@tools/size.sh sea
14 changes: 8 additions & 6 deletions tools/size.sh
@@ -1,14 +1,16 @@
#/bin/bash
#usage: ./tools/size.sh

SRC=sea-debug.js
MIN=sea.js
SRC=$1-debug.js
MIN=$1.js

SIZE_SRC=$(cat dist/$SRC | wc -c)
SIZE_MIN=$(cat dist/$MIN | wc -c)
SIZE_GZIP=$(gzip -nfc --best dist/$MIN | wc -c)

echo " `echo "scale=3;$SIZE_SRC/1024" | bc -l` KB $SRC"
echo " `echo "scale=3;$SIZE_MIN/1024" | bc -l` KB $MIN"
echo " `echo "scale=3;$SIZE_GZIP/1024" | bc -l` KB $MIN gzipped"
echo " `cat dist/sea-debug.js | wc -l` LOC"
echo
echo "\t`echo "scale=3;$SIZE_SRC/1024" | bc -l` KB $SRC"
echo "\t`echo "scale=3;$SIZE_MIN/1024" | bc -l` KB $MIN"
echo "\t`echo "scale=3;$SIZE_GZIP/1024" | bc -l` KB $MIN gzipped"
echo "\t`cat dist/$1-debug.js | wc -l` LOC"
echo

0 comments on commit 28d4338

Please sign in to comment.