sassw: accept directory as parameter

This commit is contained in:
Frédéric Péters 2019-08-23 11:56:18 +02:00
parent 0ffff88a7c
commit bad53ddec4
1 changed files with 6 additions and 0 deletions

View File

@ -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