buidler/virtualbox,vmware: only stat if not force
/cc @jasonberanek - Swapped this because why even bother doing a stat if we're forcing anyways.
This commit is contained in:
parent
276428a330
commit
245deaf599
|
@ -219,9 +219,11 @@ func (b *Builder) Prepare(raws ...interface{}) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := os.Stat(b.config.OutputDir); err == nil {
|
|
||||||
if !b.config.PackerForce {
|
if !b.config.PackerForce {
|
||||||
errs = append(errs, errors.New("Output directory already exists. It must not exist."))
|
if _, err := os.Stat(b.config.OutputDir); err == nil {
|
||||||
|
errs = append(
|
||||||
|
errs,
|
||||||
|
errors.New("Output directory already exists. It must not exist."))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -175,9 +175,11 @@ func (b *Builder) Prepare(raws ...interface{}) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := os.Stat(b.config.OutputDir); err == nil {
|
|
||||||
if !b.config.PackerForce {
|
if !b.config.PackerForce {
|
||||||
errs = append(errs, errors.New("Output directory already exists. It must not exist."))
|
if _, err := os.Stat(b.config.OutputDir); err == nil {
|
||||||
|
errs = append(
|
||||||
|
errs,
|
||||||
|
errors.New("Output directory already exists. It must not exist."))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue