mailiverse/build/compile-web-js
Timothy Prepscius 110cc20c64 changes for seds
2013-10-04 21:10:20 -04:00

35 lines
930 B
Bash
Executable File

#!/bin/bash
V=$1
M=$2
dst=www
source ./seds
HOST_PRIMARY=`cat ../config/hosts/$M`
HOST_AUTH=`cat ../config/hosts/auth_$M`
HOST_TOMCAT=`cat ../config/hosts/tomcat_$M`
HOST_WEB=`cat ../config/hosts/web_$M`
RECAPTCHA_PUBLIC_KEY=`cat ../keys/recaptcha/public.key`
function replaceStrings() {
$sed -f replace_js_$M.sed $1
$sed -e s/__VERSION__/$V/g $1
$sed -e s/__THIS_YEAR__/2013/g $1
$sed -e s/{##HOST_PRIMARY##}/$HOST_PRIMARY/g $1
$sed -e s/{##HOST_AUTH##}/$HOST_AUTH/g $1
$sed -e s/{##HOST_TOMCAT##}/$HOST_TOMCAT/g $1
$sed -e s/{##HOST_WEB##}/$HOST_WEB/g $1
$sed -e s/{##RECAPTCHA_PUBLIC_KEY##}/$RECAPTCHA_PUBLIC_KEY/g $1
}
echo Replacing Strings
replaceStrings $dst/rev/$V/client.js
replaceStrings $dst/rev/$V/signup.js
replaceStrings $dst/rev/$V/refill.js
replaceStrings $dst/rev/$V/delete.js
replaceStrings $dst/rev/$V/mobile_large.js
replaceStrings $dst/rev/$V/mobile_small.js