Skip to content

Commit

Permalink
Some more error fixes in commands
Browse files Browse the repository at this point in the history
See #1502
  • Loading branch information
bep committed Dec 2, 2015
1 parent 3f0f7ee commit c5287e7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions commands/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func NewTheme(cmd *cobra.Command, args []string) error {
jww.INFO.Println("creating theme at", createpath)

if x, _ := helpers.Exists(createpath, hugofs.SourceFs); x {
jww.FATAL.Fatalln(createpath, "already exists")
return newUserError(createpath, "already exists")
}

mkdir(createpath, "layouts", "_default")
Expand All @@ -196,8 +196,7 @@ func NewTheme(cmd *cobra.Command, args []string) error {

err := helpers.WriteToDisk(filepath.Join(createpath, "archetypes", "default.md"), bytes.NewReader(archDefault), hugofs.SourceFs)
if err != nil {

jww.FATAL.Fatalln(err)
return err
}

mkdir(createpath, "static", "js")
Expand Down Expand Up @@ -227,7 +226,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

err = helpers.WriteToDisk(filepath.Join(createpath, "LICENSE.md"), bytes.NewReader(by), hugofs.SourceFs)
if err != nil {
return nil
return err
}

createThemeMD(createpath)
Expand Down

0 comments on commit c5287e7

Please sign in to comment.