diff options
author | Bjørn Erik Pedersen <[email protected]> | 2016-09-13 10:49:19 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2016-09-13 10:49:51 +0200 |
commit | 7615ef0c2866d3068b131b9d6f80f8d432d54e13 (patch) | |
tree | 28b5896e2e9624aa5ad7daa32ac8946dab2ec039 /commands/convert.go | |
parent | be09781af1a59d3ccb323cab9c55c82964d0ae37 (diff) | |
download | hugo-7615ef0c2866d3068b131b9d6f80f8d432d54e13.tar.gz hugo-7615ef0c2866d3068b131b9d6f80f8d432d54e13.zip |
commands: Report errors in convert
Fixes #2440
Diffstat (limited to 'commands/convert.go')
-rw-r--r-- | commands/convert.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/commands/convert.go b/commands/convert.go index cd809d3e5..b9aa7b8fa 100644 --- a/commands/convert.go +++ b/commands/convert.go @@ -136,13 +136,19 @@ func convertContents(mark rune) (err error) { page.SetDir(filepath.Join(helpers.AbsPathify(viper.GetString("ContentDir")), file.Dir())) page.SetSourceContent(psr.Content()) - page.SetSourceMetaData(metadata, mark) + if err = page.SetSourceMetaData(metadata, mark); err != nil { + return err + } if outputDir != "" { - page.SaveSourceAs(filepath.Join(outputDir, page.FullFilePath())) + if err = page.SaveSourceAs(filepath.Join(outputDir, page.FullFilePath())); err != nil { + return err + } } else { if unsafe { - page.SaveSource() + if err = page.SaveSource(); err != nil { + return err + } } else { jww.FEEDBACK.Println("Unsafe operation not allowed, use --unsafe or set a different output path") } |