Skip to content

Commit

Permalink
Merge pull request #34 from missionMeteora/create_output_dirs
Browse files Browse the repository at this point in the history
Adding the creation of output dirs
  • Loading branch information
matryer authored Mar 28, 2017
2 parents a0db0c5 + 9fefe31 commit 9127e81
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 9127e81

Please sign in to comment.