Commit c3b1b979 authored by Leo Iannacone's avatar Leo Iannacone

download bootstrap as external_lib on `npm install`

parent aaec7fa1
...@@ -9,4 +9,7 @@ ...@@ -9,4 +9,7 @@
, "node-fs": "*" , "node-fs": "*"
, "tail": "*" , "tail": "*"
} }
, "scripts": {
"install": "bash scripts/download_external_libs.sh"
}
} }
#!/bin/bash
TMP_DIR="`mktemp -d`"
SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PUBLIC_DIR="${SCRIPTS_DIR}/../public/external_libs"
get_bootstrap() {
VERSION="3.1.1"
NAME="bootstrap-${VERSION}-dist"
if [ -d ${PUBLIC_DIR}/${NAME} ] ; then return ; fi
ARCHIVE=${NAME}.zip
URL="https://github.com/twbs/bootstrap/releases/download/v${VERSION}/${ARCHIVE}"
cd $TMP_DIR
echo "Downloading bootstrap ..."
curl -s -O -L ${URL} &&
unzip -q ${ARCHIVE} && mv ${NAME} ${PUBLIC_DIR}
cd && rm -r $TMP_DIR
}
mkdir -p ${PUBLIC_DIR}
get_bootstrap
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<head> <head>
<title><%= web.title %></title> <title><%= web.title %></title>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/libs/bootstrap/3.1.1/css/bootstrap.min.css"> <link rel="stylesheet" href="/external_libs/bootstrap-3.1.1-dist/css/bootstrap.min.css">
<link rel="stylesheet" href="/libs/bootstrap/3.1.1/css/bootstrap-theme.min.css"> <link rel="stylesheet" href="/external_libs/bootstrap-3.1.1-dist/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="/stylesheets/style.css"> <link rel="stylesheet" href="/stylesheets/style.css">
</head> </head>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<script src='//code.jquery.com/jquery-1.7.2.min.js'></script> <script src='//code.jquery.com/jquery-1.7.2.min.js'></script>
<script src='/socket.io/socket.io.js'></script> <script src='/socket.io/socket.io.js'></script>
<script src="/libs/bootstrap/3.1.1/js/bootstrap.min.js"></script> <script src="/external_libs/bootstrap-3.1.1-dist/js/bootstrap.min.js"></script>
<script> <script>
var config = <%- JSON.stringify(web) %> var config = <%- JSON.stringify(web) %>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment