#!/usr/bin/env python
#
# mapit_make_css:
# Generate CSS files from SCSS files.

import os
import subprocess

try:
    import mapit
except:
    import sys
    parent_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
    sys.path.insert(0, parent_dir)
    import mapit

directory = os.path.dirname(mapit.__file__)

subprocess.check_call([
    "mkdir", "-p", "%s/static/mapit/css" % directory
])
subprocess.check_call([
    "sassc", "--sourcemap",
    "--style", "compressed",
    "%s/static/mapit/sass/mapit.scss" % directory,
    "%s/static/mapit/css/mapit.css" % directory
])

