comic-hasher/path.go
2024-12-25 15:11:11 -08:00

17 lines
290 B
Go

package ch
import (
"os"
"path/filepath"
)
func RmdirP(path string) error {
err := os.Remove(path)
if err != nil {
return err
}
dir, _ := filepath.Split(path)
_ = RmdirP(dir) // We only care about errors for the first directory we always expect atleast one to fail
return nil
}