new site works in an empty directory now

This commit is contained in:
spf13
2014-05-19 09:16:40 -04:00
parent df4bbcef30
commit 6b8244ba67
2 changed files with 35 additions and 1 deletions

View File

@@ -110,7 +110,12 @@ func NewSite(cmd *cobra.Command, args []string) {
}
if x, _ := helpers.Exists(createpath); x {
jww.FATAL.Fatalln(createpath, "already exists")
y, _ := helpers.IsDir(createpath)
if z, _ := helpers.IsEmpty(createpath); y && z {
jww.INFO.Println(createpath, "already exists and is empty")
} else {
jww.FATAL.Fatalln(createpath, "already exists and is not empty")
}
}
mkdir(createpath, "layouts")