#!/bin/sh

SRC=d3-legend.js
COMPRESSED=`echo $SRC | sed 's/\.js$/.min&/'`

wget -N https://raw.githubusercontent.com/susielu/d3-legend/master/$SRC
# closure-compiler  --charset 'utf-8' --js $SRC --js_output_file $COMPRESSED # does not work
uglifyjs $SRC > $COMPRESSED