From e6541c45ab1a3d15acd1beea73df5d17d08c7769 Mon Sep 17 00:00:00 2001 From: bep Date: Wed, 10 Dec 2014 16:48:51 +0100 Subject: ERROR-log on symbolic links filepath.Walk does not follow symbolic links. There's no easy fix for that outside of Go, so the best we can do for now is to give notice to the end user by ERROR log statements. This commit also fixes a related panic situation in GenerateTemplateNameFrom when the layout dir was a symbolic link. Fixes #283 --- source/filesystem.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/filesystem.go b/source/filesystem.go index d89149dc6..df0a4989c 100644 --- a/source/filesystem.go +++ b/source/filesystem.go @@ -15,13 +15,13 @@ package source import ( "bytes" + "github.com/spf13/hugo/helpers" + jww "github.com/spf13/jwalterweatherman" "io" "io/ioutil" "os" "path/filepath" "strings" - - "github.com/spf13/hugo/helpers" ) type Input interface { @@ -84,6 +84,11 @@ func (f *Filesystem) captureFiles() { return nil } + if fi.Mode()&os.ModeSymlink == os.ModeSymlink { + jww.ERROR.Printf("Symbolic links not supported, skipping '%s'", filePath) + return nil + } + if fi.IsDir() { if f.avoid(filePath) || isNonProcessablePath(filePath) { return filepath.SkipDir -- cgit v1.2.3