mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
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
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user