resource/scss: Add IncludePaths config option

Takes paths relative to the current working dir.

Fixes #4921
This commit is contained in:
Bjørn Erik Pedersen 2018-07-20 15:02:35 +02:00
parent f01505c910
commit 166483fe12
7 changed files with 100 additions and 21 deletions

View file

@ -1,7 +1,9 @@
package hugolib
import (
"io/ioutil"
"path/filepath"
"runtime"
"testing"
"bytes"
@ -82,6 +84,20 @@ func newTestSitesBuilder(t testing.TB) *sitesBuilder {
return &sitesBuilder{T: t, Fs: fs, configFormat: "toml", dumper: litterOptions}
}
func createTempDir(prefix string) (string, func(), error) {
workDir, err := ioutil.TempDir("", prefix)
if err != nil {
return "", nil, err
}
if runtime.GOOS == "darwin" && !strings.HasPrefix(workDir, "/private") {
// To get the entry folder in line with the rest. This its a little bit
// mysterious, but so be it.
workDir = "/private" + workDir
}
return workDir, func() { os.RemoveAll(workDir) }, nil
}
func (s *sitesBuilder) Running() *sitesBuilder {
s.running = true
return s