mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-26 01:33:14 +00:00
parent
ffdbce5787
commit
e96cdfe966
3 changed files with 11 additions and 6 deletions
|
@ -116,13 +116,9 @@ func newFs(source, destination afero.Fs, workingDir, publishDir string) *Fs {
|
|||
panic("workingDir is too short")
|
||||
}
|
||||
|
||||
// If this does not exist, it will be created later.
|
||||
absPublishDir := paths.AbsPathify(workingDir, publishDir)
|
||||
|
||||
// Make sure we always have the /public folder ready to use.
|
||||
if err := source.MkdirAll(absPublishDir, 0777); err != nil && !os.IsExist(err) {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
pubFs := afero.NewBasePathFs(destination, absPublishDir)
|
||||
|
||||
return &Fs{
|
||||
|
|
|
@ -132,6 +132,11 @@ var commonTestScriptsParam = testscript.Params{
|
|||
if err != nil {
|
||||
ts.Fatalf("%v", err)
|
||||
}
|
||||
if len(fis) == 0 {
|
||||
// To simplify empty dir checks.
|
||||
fmt.Fprintln(ts.Stdout(), "Empty dir")
|
||||
return
|
||||
}
|
||||
for _, fi := range fis {
|
||||
fmt.Fprintf(ts.Stdout(), "%s %04o %s %s\n", fi.Mode(), fi.Mode().Perm(), fi.ModTime().Format(time.RFC3339Nano), fi.Name())
|
||||
}
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
|
||||
mkdir mysite
|
||||
cd mysite
|
||||
! hugo
|
||||
|
||||
stderr 'Unable to locate config file or config directory'
|
||||
stderr 'Unable to locate config file or config directory'
|
||||
ls .
|
||||
stdout 'Empty dir'
|
Loading…
Reference in a new issue