summaryrefslogtreecommitdiffstats
path: root/commands/hugo.go
diff options
context:
space:
mode:
authorAlbert Nigmatzianov <albertnigma@gmail.com>2017-05-08 17:55:48 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-05-09 14:07:43 +0200
commit9b2028626e2e50f6d3502bcd87543aa4bd5d04d0 (patch)
tree5c86e58b4aec60d7ea87092e1e398a0bb9cd6040 /commands/hugo.go
parentc99761555c014e4d041438d5d7e53a6cbaee4492 (diff)
commands: Use paths from PathSpec for walker
Diffstat (limited to 'commands/hugo.go')
-rw-r--r--commands/hugo.go15
1 files changed, 5 insertions, 10 deletions
diff --git a/commands/hugo.go b/commands/hugo.go
index ce246efd0..4c12ccc7d 100644
--- a/commands/hugo.go
+++ b/commands/hugo.go
@@ -616,13 +616,8 @@ func (c *commandeer) getDirList() []string {
var a []string
dataDir := c.PathSpec().AbsPathify(c.Cfg.GetString("dataDir"))
i18nDir := c.PathSpec().AbsPathify(c.Cfg.GetString("i18nDir"))
- layoutDir := c.PathSpec().AbsPathify(c.Cfg.GetString("layoutDir"))
- staticDir := c.PathSpec().AbsPathify(c.Cfg.GetString("staticDir"))
- var themesDir string
-
- if c.PathSpec().ThemeSet() {
- themesDir = c.PathSpec().AbsPathify(c.Cfg.GetString("themesDir") + "/" + c.Cfg.GetString("theme"))
- }
+ layoutDir := c.PathSpec().GetLayoutDirPath()
+ staticDir := c.PathSpec().GetStaticDirPath()
walker := func(path string, fi os.FileInfo, err error) error {
if err != nil {
@@ -686,15 +681,15 @@ func (c *commandeer) getDirList() []string {
_ = helpers.SymbolicWalk(c.Fs.Source, dataDir, walker)
_ = helpers.SymbolicWalk(c.Fs.Source, c.PathSpec().AbsPathify(c.Cfg.GetString("contentDir")), walker)
_ = helpers.SymbolicWalk(c.Fs.Source, i18nDir, walker)
- _ = helpers.SymbolicWalk(c.Fs.Source, c.PathSpec().AbsPathify(c.Cfg.GetString("layoutDir")), walker)
-
+ _ = helpers.SymbolicWalk(c.Fs.Source, layoutDir, walker)
_ = helpers.SymbolicWalk(c.Fs.Source, staticDir, walker)
+
if c.PathSpec().ThemeSet() {
+ themesDir := c.PathSpec().GetThemeDir()
_ = helpers.SymbolicWalk(c.Fs.Source, filepath.Join(themesDir, "layouts"), walker)
_ = helpers.SymbolicWalk(c.Fs.Source, filepath.Join(themesDir, "static"), walker)
_ = helpers.SymbolicWalk(c.Fs.Source, filepath.Join(themesDir, "i18n"), walker)
_ = helpers.SymbolicWalk(c.Fs.Source, filepath.Join(themesDir, "data"), walker)
-
}
return a