Commit abe9bf85 authored by Seth Vargo's avatar Seth Vargo

Ensure parent directories are created for base boxes

parent 8dcabe97
...@@ -39,6 +39,13 @@ func CopyContents(dst, src string) error { ...@@ -39,6 +39,13 @@ func CopyContents(dst, src string) error {
// actually a proper box. This is an expected precondition. // actually a proper box. This is an expected precondition.
func DirToBox(dst, dir string, ui packer.Ui, level int) error { func DirToBox(dst, dir string, ui packer.Ui, level int) error {
log.Printf("Turning dir into box: %s => %s", dir, dst) 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) dstF, err := os.Create(dst)
if err != nil { if err != nil {
return err 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