Update to newest pkglib

This commit is contained in:
Tom Wiesing 2023-04-09 22:00:24 +02:00
parent 1bdcb6e3b4
commit 7ff2ecf7fe
No known key found for this signature in database
11 changed files with 95 additions and 41 deletions

View file

@ -42,9 +42,15 @@ func (pv *Provision) Provision(progress io.Writer, ctx context.Context, flags Pr
}
// check that the base directory does not exist
logging.LogMessage(progress, "Checking that base directory %s does not exist", instance.FilesystemBase)
if fsx.IsDirectory(instance.FilesystemBase) {
return nil, ErrInstanceAlreadyExists
{
logging.LogMessage(progress, "Checking that base directory %s does not exist", instance.FilesystemBase)
exists, err := fsx.Exists(instance.FilesystemBase)
if err != nil {
return nil, err
}
if exists {
return nil, ErrInstanceAlreadyExists
}
}
// Store in the instances table!