all repos — vite @ 0a2b893a2ec830c9de1a0e25555e9068820eef65

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

init.go (view raw)

 1package main
 2
 3import (
 4	"os"
 5	"path/filepath"
 6)
 7
 8func viteInit(path string) {
 9	paths := []string{"build", "pages", "static", "templates"}
10	var dirPath string
11	for _, p := range paths {
12		dirPath = filepath.Join(path, p)
13		err := os.MkdirAll(dirPath, 0755)
14		if err != nil {
15			printErr(err)
16			return
17		}
18	}
19	fp, _ := filepath.Abs(path)
20	printMsg("created project:", fp)
21}