Files
dokku/plugins/builder/functions.go
Jose Diaz-Gonzalez 377ca5ca22 fix: properly handle directory replacement
The previous version _also_ deleted the temp working dir, causing issues with subsequent directory access.
2021-07-10 14:57:58 -04:00

21 lines
278 B
Go

package builder
import (
"io/ioutil"
"os"
"path"
)
func removeAllContents(basePath string) error {
dir, err := ioutil.ReadDir(basePath)
if err != nil {
return err
}
for _, d := range dir {
os.RemoveAll(path.Join([]string{basePath, d.Name()}...))
}
return nil
}