all repos — vite @ 6b7947f82db15780f91b97b0b2360577551c2d05

a fast (this time, actually) and minimal static site generator

util/rmall.go (view raw)

 1package util
 2
 3import (
 4	"os"
 5	"path/filepath"
 6)
 7
 8// Cleans a given directory, removing all files and subdirs.
 9func Clean(dir string) error {
10	files, err := filepath.Glob(filepath.Join(dir, "*"))
11	if err != nil {
12		return err
13	}
14
15	for _, file := range files {
16		err = os.RemoveAll(file)
17		if err != nil {
18			return err
19		}
20	}
21	return nil
22}