mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 06:30:33 +03: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:
parent
9f77f93071
commit
e6541c45ab
3 changed files with 24 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue