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{
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())
}
+mkdir mysite
+cd mysite
! hugo
-stderr 'Unable to locate config file or config directory'
\ No newline at end of file
+stderr 'Unable to locate config file or config directory'
+ls .
+stdout 'Empty dir'
\ No newline at end of file