all repos — vite @ c720289599cf73858c8150484d1b3fdafcaa5595

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

init.go (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
package main

import (
	"os"
	"path/filepath"
)

func viteInit(path string) {
	paths := []string{"build", "pages", "static", "templates"}
	var dirPath string
	for _, p := range paths {
		dirPath = filepath.Join(path, p)
		err := os.MkdirAll(dirPath, 0755)
		if err != nil {
			printErr(err)
			return
		}
	}
	fp, _ := filepath.Abs(path)
	printMsg("created project:", fp)
}