mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
The previous version _also_ deleted the temp working dir, causing issues with subsequent directory access.
21 lines
278 B
Go
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
|
|
}
|