all repos — vite @ c0b82b5ec6f99973d963088f56ca1b237d1743ac

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}