Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja> git-svn-id: file:///srv/svn/repo/aya/trunk@79 cec141ff-132a-4243-88a5-ce187bd62f94
31 lines
651 B
Go
31 lines
651 B
Go
// Render .gcss files into .css
|
|
package main
|
|
|
|
import (
|
|
"io"
|
|
"os"
|
|
"path/filepath"
|
|
"strings"
|
|
"github.com/yosssi/gcss"
|
|
)
|
|
|
|
func buildGCSS(path string, w io.Writer) error {
|
|
f, err := os.Open(path)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
defer f.Close()
|
|
|
|
if w == nil {
|
|
s := strings.TrimSuffix(path, ".gcss") + ".css"
|
|
css, err := os.Create(filepath.Join(PUBDIR, s))
|
|
if err != nil {
|
|
return err
|
|
}
|
|
defer css.Close()
|
|
w = css
|
|
}
|
|
_, err = gcss.Compile(w, f)
|
|
return err
|
|
}
|