summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPeter 'Pita' Martischka <petermartischka@googlemail.com>2011-06-30 18:06:07 +0100
committerPeter 'Pita' Martischka <petermartischka@googlemail.com>2011-06-30 18:06:07 +0100
commit95b47b4940d63e2b97747a79d47ee2fe5345173b (patch)
tree5f62c310a28eb67c8d3226d1407f3156cc32cdd8 /bin
parentc98db5a4c11ce4ba1eee2dd69c1c1d87f3c1b981 (diff)
downloadetherpad-lite-95b47b4940d63e2b97747a79d47ee2fe5345173b.zip
use a downloaded jQuery instead of using googles CDN, and fixed btw a bug that let pad.js fails randomly
Diffstat (limited to 'bin')
-rwxr-xr-xbin/run.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/bin/run.sh b/bin/run.sh
index 3940e87c..f1a1af99 100755
--- a/bin/run.sh
+++ b/bin/run.sh
@@ -37,6 +37,21 @@ fi
echo "Ensure that all dependencies are up to date..."
npm install
+echo "Ensure jQuery is downloaded and up to date..."
+DOWNLOAD_JQUERY="true"
+NEEDED_VERSION="1.6.1"
+if [ -f "static/js/jquery.min.js" ]; then
+ VERSION=$(cat static/js/jquery.min.js | head -n 2 | tail -n 1 | grep -o "v[0-9]*\.[0-9]*\.[0-9]*");
+
+ if [[ ${VERSION:1} = $NEEDED_VERSION ]]; then
+ DOWNLOAD_JQUERY="false"
+ fi
+fi
+
+if [[ $DOWNLOAD_JQUERY = "true" ]]; then
+ wget -O static/js/jquery.min.js http://code.jquery.com/jquery-$NEEDED_VERSION.min.js
+fi
+
#Remove all minified data to force node creating it new
echo "Clear minfified cache..."
rm var/minified* 2> /dev/null