#!/bin/bash set -x V=$1 M=$2 APP_TITLE=`cat ../config/title` COMPANY=`cat ../config/company` source ./seds dst=www cmn_src=../web/common client_src=../web/client signup_src=../web/signup refill_src=../web/refill delete_src=../web/delete mobile_large=../web/mobile_large mobile_small=../web/mobile_small learnmore=../web/learnmore function replaceStrings() { echo $1 $M $sed -f replace_html.sed $1 $sed -f replace_html_$M.sed $1 $sed -e s/__VERSION__/$V/g $1 $sed -e s/__THIS_YEAR__/2013/g $1 echo $COMPANY $sed -e s/{##TITLE##}/$APP_TITLE/g $1 $sed -e s/{##COMPANY##}/"$COMPANY"/g $1 } echo Compiling CSS/JS rm -rf $dst/rev mkdir -p $dst/rev/$V cat $cmn_src/*.css $client_src/*.css > $dst/rev/$V/client.css cat $cmn_src/*.js $client_src/*.js > $dst/rev/$V/client.js cat $cmn_src/*.css $signup_src/*.css > $dst/rev/$V/signup.css cat $cmn_src/*.js $signup_src/*.js > $dst/rev/$V/signup.js cat $cmn_src/*.css $refill_src/*.css > $dst/rev/$V/refill.css cat $cmn_src/*.js $refill_src/*.js > $dst/rev/$V/refill.js cat $cmn_src/*.css $delete_src/*.css > $dst/rev/$V/delete.css cat $cmn_src/*.js $delete_src/*.js > $dst/rev/$V/delete.js cat $cmn_src/*.js $client_src/*.js $mobile_large/*.js > $dst/rev/$V/mobile_large.js cat $cmn_src/*.css $client_src/*.css $mobile_large/*.css > $dst/rev/$V/mobile_large.css cat $cmn_src/*.js $client_src/*.js $mobile_small/*.js > $dst/rev/$V/mobile_small.js cat $cmn_src/*.css $client_src/*.css $mobile_small/*.css > $dst/rev/$V/mobile_small.css cat $cmn_src/*.css $learnmore/*.css > $dst/rev/$V/learnmore.css echo Copying cp $client_src/index.html $dst/index.html cp $signup_src/signup.html $dst/signup.html cp $refill_src/refill.html $dst/refill.html cp $delete_src/delete.html $dst/delete.html cp $mobile_large/mobile_large.html $dst/mobile_large.html cp $mobile_small/mobile_small.html $dst/mobile_small.html cp $learnmore/learnmore.html $dst/learnmore.html cp $learnmore/technical.html $dst/technical.html cp $signup_src/DropboxAuthorized.html $dst/DropboxAuthorized.html echo Replacing Strings replaceStrings $dst/index.html replaceStrings $dst/signup.html replaceStrings $dst/refill.html replaceStrings $dst/delete.html replaceStrings $dst/mobile_large.html replaceStrings $dst/mobile_small.html replaceStrings $dst/learnmore.html replaceStrings $dst/technical.html replaceStrings $dst/DropboxAuthorized.html