2013-08-09 16:31:05 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
V=$1
|
|
|
|
M=$2
|
2013-09-02 13:20:56 -04:00
|
|
|
dst=www
|
|
|
|
|
2013-09-05 15:36:14 -04:00
|
|
|
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`
|
2013-09-29 15:12:15 -04:00
|
|
|
RECAPTCHA_PUBLIC_KEY=`cat ../keys/recaptcha/public.key`
|
2013-08-09 16:31:05 -04:00
|
|
|
|
|
|
|
function replaceStrings() {
|
|
|
|
sed -i '' -f replace_js_$M.sed $1
|
|
|
|
sed -i '' -e s/__VERSION__/$V/g $1
|
|
|
|
sed -i '' -e s/__THIS_YEAR__/2013/g $1
|
2013-09-02 13:20:56 -04:00
|
|
|
|
|
|
|
sed -i '' -e s/{##HOST_PRIMARY##}/$HOST_PRIMARY/g $1
|
|
|
|
sed -i '' -e s/{##HOST_AUTH##}/$HOST_AUTH/g $1
|
|
|
|
sed -i '' -e s/{##HOST_TOMCAT##}/$HOST_TOMCAT/g $1
|
|
|
|
sed -i '' -e s/{##HOST_WEB##}/$HOST_WEB/g $1
|
2013-09-29 15:12:15 -04:00
|
|
|
sed -i '' -e s/{##RECAPTCHA_PUBLIC_KEY##}/$RECAPTCHA_PUBLIC_KEY/g $1
|
2013-08-09 16:31:05 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
|