diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-09-11 19:59:07 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-09-11 20:00:38 +0200 |
commit | c700cdc39cdf6b8801b71b70f704d749650585fd (patch) | |
tree | cd3e0d4eb10729d64a4d8f3d6f2433e40e512e8d /helpers | |
parent | ef3c4a56d8c5e62588b315cea800a15160ea4eb5 (diff) |
Replace some leftover os.Stat with hugofs.Source
Diffstat (limited to 'helpers')
-rw-r--r-- | helpers/path.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/helpers/path.go b/helpers/path.go index 478512efa..b7e6f51a9 100644 --- a/helpers/path.go +++ b/helpers/path.go @@ -23,6 +23,8 @@ import ( "strings" "unicode" + "github.com/spf13/hugo/hugofs" + "github.com/spf13/afero" "github.com/spf13/viper" "golang.org/x/text/transform" @@ -194,7 +196,7 @@ func getThemeDirPath(path string) (string, error) { } themeDir := filepath.Join(GetThemeDir(), path) - if _, err := os.Stat(themeDir); os.IsNotExist(err) { + if _, err := hugofs.Source().Stat(themeDir); os.IsNotExist(err) { return "", fmt.Errorf("Unable to find %s directory for theme %s in %s", path, viper.GetString("theme"), themeDir) } |