builder/vmware-iso: set local output dir
This commit is contained in:
parent
56c5628205
commit
f8df5f81db
|
@ -199,7 +199,10 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
|
|||
default:
|
||||
dir = new(vmwcommon.LocalOutputDir)
|
||||
}
|
||||
|
||||
var localDir localOutputDir
|
||||
if b.config.RemoteType != "" && b.config.Format != "" {
|
||||
localDir = localOutputDir{b.config.OutputDir}
|
||||
b.config.OutputDir = b.config.VMName
|
||||
}
|
||||
dir.SetOutputDir(b.config.OutputDir)
|
||||
|
@ -210,6 +213,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
|
|||
state.Put("config", &b.config)
|
||||
state.Put("debug", b.config.PackerDebug)
|
||||
state.Put("dir", dir)
|
||||
state.Put("localDir", localDir)
|
||||
state.Put("driver", driver)
|
||||
state.Put("hook", hook)
|
||||
state.Put("ui", ui)
|
||||
|
|
|
@ -59,7 +59,8 @@ func (s *StepExport) Run(state multistep.StateBag) multistep.StepAction {
|
|||
}
|
||||
|
||||
// Export the VM
|
||||
outputPath := filepath.Join(c.OutputDir, c.VMName+"."+s.Format)
|
||||
localDir := state.Get("localDir").(localOutputDir)
|
||||
outputPath := filepath.Join(fmt.Sprintf("%v", localDir), c.VMName+"."+s.Format)
|
||||
|
||||
if s.Format == "ova" {
|
||||
os.MkdirAll(outputPath, 0755)
|
||||
|
|
Loading…
Reference in New Issue