From 2a9ade8da0d61583ba7af8846975300796f14165 Mon Sep 17 00:00:00 2001 From: Brian Duggan Date: Wed, 23 May 2018 11:49:05 -0400 Subject: [PATCH] Add option to watch for changes to css --- README.md | 6 ++++++ gen-css | 13 +++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6dfd94ff..bca802ef 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,14 @@ ## Running (development) +To start the app and watch for changes: + DEBUG=1 ./app.py +To rebuild css whenever the scss changes: + + ./gen-css --watch + ## Notes tornado templates are like mustache templates -- add the diff --git a/gen-css b/gen-css index da4cb20c..ad996c67 100755 --- a/gen-css +++ b/gen-css @@ -1,5 +1,14 @@ -#!/bin/sh -x +#!/bin/sh + +opts=$1 cp -a node_modules/uswds/dist/fonts static/ -sass scss/atat.scss > static/assets/atat.css + +if [ "$opts" == "--watch" ]; then + set -x + sass --watch scss/atat.scss:static/assets/atat.css +else + set -x + sass scss/atat.scss > static/assets/atat.css +fi