From 6b8244ba67cede0c2c95bde695cf3c54002bce74 Mon Sep 17 00:00:00 2001 From: spf13 Date: Mon, 19 May 2014 09:16:40 -0400 Subject: new site works in an empty directory now --- commands/new.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'commands/new.go') diff --git a/commands/new.go b/commands/new.go index 1c3e8e9e5..68ddbb4f6 100644 --- a/commands/new.go +++ b/commands/new.go @@ -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") -- cgit v1.2.3