Skip to content

Instantly share code, notes, and snippets.

@marcoslhc
Last active October 13, 2015 08:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save marcoslhc/4170535 to your computer and use it in GitHub Desktop.
make twitter bootstrap from dev
#!/bin/sh
echo "# @Autor: Marcos Hernández @email:marcoslhc@gmail.com"
echo "# @Licencia:"
echo "# Está obra está sujeta a la licencia "
echo "# GENERAL PUBLIC LICENSE"
echo "# Para ver una copia de esta licencia, visite "
echo "# http://gnu.org/license/gpl.html"
echo
# Crea un directorio build
# build/
# css/
# less/
# js/
# index.html
#
if [ ! -d "build" ]; then
mkdir build
fi
if [ ! -d "build/js" ]; then
mkdir build/js
fi
if [ ! -d "build/less" ]; then
mkdir build/less
fi
if [ ! -d "build/css" ]; then
mkdir build/css
fi
# Concatena los scripts _en orden_ para evitar errores y los copia en build/js
cd js
cat bootstrap-affix.js bootstrap-alert.js bootstrap-button.js bootstrap-carousel.js bootstrap-collapse.js bootstrap-dropdown.js bootstrap-modal.js bootstrap-tooltip.js bootstrap-popover.js bootstrap-scrollspy.js bootstrap-tab.js bootstrap-transition.js bootstrap-typeahead.js > ../build/js/bootstrap.js
# Copia los archivos less en build/less esto para tener un sandbox
cd ..
cp less/*.less build/less/
# compila los archivos less existentes
lessc build/less/bootstrap.less build/css/bootstrap.css
# crea un index.html para empezar :)
cd build
echo "<!DOCTYPE HTML>" > index.html
echo "<html lang=""en-US"">" >> index.html
echo "<head>" >> index.html
echo " <meta charset=""UTF-8"">" >> index.html
echo " <script type=""text/javascript"">" >> index.html
echo " /* Minimal Async load of the scripts */" >> index.html
echo " (function () {" >> index.html
echo " /* Library list. Must be in order of requirements */" >> index.html
echo " var libs = [" >> index.html
echo " {" >> index.html
echo " name:'jquery'," >> index.html
echo " url:'http://code.jquery.com/jquery-latest.js'" >> index.html
echo " }," >> index.html
echo " {" >> index.html
echo " name:'bootstrap'," >> index.html
echo " url:'js/bootstrap.js'" >> index.html
echo " }];" >> index.html
echo " for(var i=0;i<libs.length;i++){" >> index.html
echo " var script = document.createElement('script');" >> index.html
echo " script.type = 'text/javascript'; script.async = true;" >> index.html
echo " script.src = libs[i].url;" >> index.html
echo " var s = document.getElementsByTagName('script')[i];" >> index.html
echo " s.parentNode.insertBefore(script, s);" >> index.html
echo " }" >> index.html
echo " })();" >> index.html
echo " </script>" >> index.html
echo " <title></title>" >> index.html
echo " <link rel=""stylesheet"" type=""text/css"" href=""css/bootstrap.css"" media=""all"" />" >> index.html
echo "</head>" >> index.html
echo "<body>" >> index.html
echo " <div class=""container"">" >> index.html
echo " <div class=""row"">" >> index.html
echo " <div class=""page-header"">" >> index.html
echo " <h1>Hello!...; <small>All the world</small></h1>" >> index.html
echo " </div>" >> index.html
echo " </div>" >> index.html
echo " <div class=""row"">" >> index.html
echo " <div class=""hero-unit"">" >> index.html
echo " <h1>Hello, World!</h1>" >> index.html
echo " </div>" >> index.html
echo " </div>" >> index.html
echo " </div>" >> index.html
echo "</body>" >> index.html
echo "</html>" >> index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment