Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
Create the parent directories for the files
Browse files Browse the repository at this point in the history
  • Loading branch information
tombooth committed Dec 29, 2017
1 parent c489a42 commit c1de20f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"io/ioutil"
"net/url"
"os"
"path/filepath"
"strconv"
"strings"

Expand Down Expand Up @@ -71,6 +72,10 @@ func main() {
panic(err)
}

if err = os.MkdirAll(filepath.Dir(outPath), os.FileMode(0755)); err != nil {
panic(err)
}

if err = ioutil.WriteFile(outPath, objectData, fileMode); err != nil {
panic(err)
}
Expand Down

0 comments on commit c1de20f

Please sign in to comment.