summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2019-08-23 09:56:18 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2019-08-23 09:56:18 (GMT)
commitbad53ddec42b27952e51bfc50ef951eaa60500f3 (patch)
tree99245b7f89eb058b83e7074417f9d7ae41795804
parent0ffff88a7c8a903332b8a46783f08f3d07646799 (diff)
downloadmisc-fred-bad53ddec42b27952e51bfc50ef951eaa60500f3.zip
misc-fred-bad53ddec42b27952e51bfc50ef951eaa60500f3.tar.gz
misc-fred-bad53ddec42b27952e51bfc50ef951eaa60500f3.tar.bz2
sassw: accept directory as parameter
-rwxr-xr-xbin/sassw6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/sassw b/bin/sassw
index e580f02..f936346 100755
--- a/bin/sassw
+++ b/bin/sassw
@@ -7,6 +7,7 @@
# (output will automatically be INPUT with .scss changed to .css)
import json
+import glob
import os
import pyinotify
import subprocess
@@ -14,6 +15,11 @@ import sys
import time
filename = sys.argv[1]
+if os.path.isdir(filename):
+ scss_filenames = [x for x in os.listdir(filename) if x.startswith('_') and x.endswith('.scss')]
+ if not scss_filenames:
+ print('Error: directory specified but no proper scss file within.', file=sys.stderr)
+ filename = os.path.join(filename, scss_filenames[0])
def build():
global sources, directories