Commit b098e7aa authored by Ross Smith II's avatar Ross Smith II

Merge pull request #1060 from sethvargo/sethvargo/mkdir_p

Ensure parent directories are created for base boxes, fixes #1059
parents 8dcabe97 abe9bf85
......@@ -39,6 +39,13 @@ func CopyContents(dst, src string) error {
// actually a proper box. This is an expected precondition.
func DirToBox(dst, dir string, ui packer.Ui, level int) error {
log.Printf("Turning dir into box: %s => %s", dir, dst)
// Make the containing directory, if it does not already exist
err := os.MkdirAll(filepath.Dir(dst), 0755)
if err != nil {
return err
}
dstF, err := os.Create(dst)
if err != nil {
return err
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment