This repository has been archived by the owner. It is now read-only.
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
72 lines (55 sloc) 1.4 KB
#!/usr/bin/env bash
# Dependencies :
# - https://github.com/ShaneKilkelly/manuel
# - https://github.com/ShaneKilkelly/manuel-contrib-watch
# $HOME/.manuel.d/plugins/manuel-contrib-watch
load_plugin manuel-contrib-watch
# Include fakestache configuration files
. config/site.cfg
. config/app.cfg
# Concatenate and minify assets
# Then build the static site
function build () {
./bootstrap
./preprocess_css
./preprocess_javascript
case $1 in
-d|--dev)
./fakestache -r -d
;;
*)
./fakestache -r
;;
esac
echo "- $SITE_DOMAINNAME is builded!"
}
# Build the static site
# Then deploy it to the web server
function deploy () {
build
./deploy
echo "- ... and deployed!"
}
# Concatenate and minify stylesheets
# Then export with rsync
function update_css () {
./preprocess_css
rsync -avmh "./$ASSETS/css/" "$TMP_PATH/$PUBLICHTML/css/"
rsync -avmh "./$ASSETS/css/" "./$PUBLICHTML/css/"
}
# Concatenate and minify scripts
# Then export with rsync
function update_js () {
./preprocess_javascript
rsync -avmh "./$ASSETS/js/" "$TMP_PATH/$PUBLICHTML/js/"
rsync -avmh "./$ASSETS/js/" "./$PUBLICHTML/js/"
}
# Watch CSS and JS files
# Then update them
function watch_assets_change () {
declare -A actions=(
["*?css"]="update_css"
["*?js"]="update_js"
)
manuel_watch "./static/dev/"
}