Forráskód Böngészése

updated some comments

Casey DeLorme 10 éve
szülő
commit
9cd7bfc374
1 módosított fájl, 3 hozzáadás és 3 törlés
  1. 3 3
      main.go

+ 3 - 3
main.go

@@ -42,7 +42,7 @@ func version() string {
 	return version
 }
 
-// remove the extension from a given filename
+// remove the path and extension from a given filename
 func basename(name string) string {
 	return filepath.Base(strings.TrimSuffix(name, filepath.Ext(name)))
 }
@@ -55,8 +55,6 @@ func main() {
 	// prepare staticmd with dependencies & defaults
 	staticmd := Staticmd{
 		Logger:         log.Logger{Level: log.Error},
-		Subdirectories: make(map[string][]string),
-		Indexes:        make(map[string][]string),
 		Version:        version(),
 		Input:          cwd,
 		Output:         filepath.Join(cwd, "public/"),
@@ -83,6 +81,7 @@ func main() {
 	t, _ := maps.String(&flags, "", "template")
 	if tmpl, err := template.ParseFiles(t); err != nil {
 		staticmd.Logger.Error("Failed to open template: %s", err)
+		os.Exit(1)
 	} else {
 		staticmd.Template = *tmpl
 	}
@@ -114,6 +113,7 @@ func main() {
 	// print debug status
 	staticmd.Logger.Debug("Staticmd State: %+v", staticmd)
 
+	// walk the file system
 	if err := filepath.Walk(staticmd.Input, staticmd.Walk); err != nil {
 		staticmd.Logger.Error("failed to walk directory: %s", err)
 	}