Skip to content

Commit

Permalink
Adding the creation of output dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmontoya committed Mar 28, 2017
1 parent e8e29e6 commit 9fefe31
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"io/ioutil"
"net/http"
"os"
"path"
"strings"

"github.com/cheekybits/genny/parse"
Expand Down Expand Up @@ -62,6 +63,11 @@ func main() {

var outWriter io.Writer
if len(*out) > 0 {
err := os.MkdirAll(path.Dir(*out), 0755)
if err != nil {
fatal(exitcodeDestFileFailed, err)
}

outFile, err := os.Create(*out)
if err != nil {
fatal(exitcodeDestFileFailed, err)
Expand Down

0 comments on commit 9fefe31

Please sign in to comment.