#!/bin/sh ########################################################### # SET THE FOLLOWING VARIABLES AS NEEDED # stamp, crumb, minify, target, server, buildpath, # scriptpath, csspath as needed ########################################################### ######################################################################## ### stamp - version of the protoscripter bm ### YYYYMMDDHHMM stamp="200709031700" ######################################################################## ######################################################################## ### minify - whether to minify ### minify=1 : jlecomte minifier ### minify=2 : crockford jsmin ### minify=0 : no minification minify=2 ######################################################################## ######################################################################## ### psbmpath - where the startpsbm.js file lives (the protoscripter ### bootstrapper script -- called by the actual bookmarklet) #psbmpath="http:\/\/localhost\/~bscott\/protoscript\/scripts\/startpsbm.js" psbmpath="http:\/\/protoscript.com\/scripts\/startpsbm.js" ######################################################################## ######################################################################## ### scriptpath - where bookmarklet lives #scriptpath="http:\/\/localhost\/~bscott\/protoscript\/scripts\/psbm_" scriptpath="http:\/\/protoscript.com\/scripts\/psbm_" ######################################################################## ######################################################################## ### csspath - where bookmarklet css lives #csspath="http:\/\/localhost\/~bscott\/protoscript\/css\/psbm_" csspath="http:\/\/protoscript.com\/css\/psbm_" ######################################################################## ######################################################################## ### buildpath - your local protoscript build dir buildpath=/Users/bscott/Sites/protoscript/build ######################################################################## ######## DON'T CHANGE BELOW HERE ######## ######## DON'T CHANGE BELOW HERE ######## ######## DON'T CHANGE BELOW HERE ######## cd $buildpath # Clean up previously generated script, css files rm -f $buildpath/*.js rm -f $buildpath/*.css # Clean up previous stamped script, css files in the script, css directories rm -f ../scripts/psbm_2007*.js rm -f ../css/psbm_2007*.css stamp_path_subst='s/@STAMP@/'"$stamp"'/g' script_path_subst='s/@SCRIPT_PATH@/'"$scriptpath"'/g' css_path_subst='s/@CSS_PATH@/'"$csspath"'/g' sed -e $stamp_path_subst -e $script_path_subst -e $css_path_subst <../scripts/_startpsbm.js > ../scripts/startpsbm.js sed -e 's/@PSBM_PATH@/'"$psbmpath"'/g' <../_bookmarklet.inc > ../bookmarklet.inc if [ $minify = 1 ]; then java -jar YUICompressor.jar ../scripts/jquery-1.1.3.1.js -o jquery-1.1.3.1.js java -jar YUICompressor.jar ../scripts/yui_proto.js -o yui_proto.js java -jar YUICompressor.jar ../scripts/proto.js -o proto.js java -jar YUICompressor.jar ../scripts/psbm.js -o psbm.js echo "JLMin Minified Version" elif [ $minify = 2 ]; then jsmin <../scripts/jquery-1.1.3.1.js >jquery-1.1.3.1.js jsmin <../scripts/yui_proto.js >yui_proto.js jsmin <../scripts/proto.js >proto.js jsmin <../scripts/psbm.js >psbm.js echo "JSMin Minified Version" else cp ../scripts/jquery-1.1.3.1.js jquery-1.1.3.1.js cp ../scripts/yui_proto.js yui_proto.js cp ../scripts/proto.js proto.js cp ../scripts/psbm.js psbm.js echo "Non-Minified Version" fi # Concatenate scripts cat yui/utilities.js yui/container-min.js jquery-1.1.3.1.js yui_proto.js proto.js psbm.js > ../scripts/psbm_$stamp.js cat yui/container.css ../css/psbm.css > ../css/psbm_$stamp.css ### echo "Finished building psbm with time stamp:$stamp"