Commit e239579

mo khan <mo@mokhan.ca>
2026-01-31 02:45:07
refactor: remove NO_FILES and NO_COMMITS_LIST
1 parent c4260fb
Changed files (1)
cmd
gitmal
cmd/gitmal/main.go
@@ -35,9 +35,6 @@ func main() {
 		defer pprof.WriteHeapProfile(memProf)
 	}
 
-	_, noFiles := os.LookupEnv("NO_FILES")
-	_, noCommitsList := os.LookupEnv("NO_COMMITS_LIST")
-
 	flag.StringVar(&flagOutput, "output", "output", "Output directory")
 	flag.Usage = usage
 	flag.Parse()
@@ -144,37 +141,33 @@ func main() {
 		generator.Echo(fmt.Sprintf("> [%d/%d] %s@%s", i+1, len(branches), params.Name, branch))
 		params.Ref = branch
 
-		if !noFiles {
-			files, err := git.Files(params.Ref, params.RepoDir)
-			if err != nil {
-				panic(err)
-			}
+		files, err := git.Files(params.Ref, params.RepoDir)
+		if err != nil {
+			panic(err)
+		}
 
-			if branch.String() == defaultBranch {
-				defaultBranchFiles = files
-			}
+		if branch.String() == defaultBranch {
+			defaultBranchFiles = files
+		}
 
-			if err := generator.GenerateBlobs(files, params); err != nil {
-				panic(err)
-			}
+		if err := generator.GenerateBlobs(files, params); err != nil {
+			panic(err)
+		}
 
-			if err := generator.GenerateLists(files, params); err != nil {
-				panic(err)
-			}
+		if err := generator.GenerateLists(files, params); err != nil {
+			panic(err)
 		}
 
-		if !noCommitsList {
-			if err := generator.GenerateLogForBranch(commitsFor[branch], params); err != nil {
-				panic(err)
-			}
+		if err := generator.GenerateLogForBranch(commitsFor[branch], params); err != nil {
+			panic(err)
+		}
 
-			if err := generator.GenerateCommitsJSON(commitsFor[branch], params); err != nil {
-				panic(err)
-			}
+		if err := generator.GenerateCommitsJSON(commitsFor[branch], params); err != nil {
+			panic(err)
+		}
 
-			if err := generator.GenerateCommitsAtom(commitsFor[branch], params); err != nil {
-				panic(err)
-			}
+		if err := generator.GenerateCommitsAtom(commitsFor[branch], params); err != nil {
+			panic(err)
 		}
 	}
 
@@ -197,13 +190,11 @@ func main() {
 		panic(err)
 	}
 
-	if !noFiles {
-		if len(defaultBranchFiles) == 0 {
-			panic("No files found for default branch")
-		}
-		if err := generator.GenerateIndex(defaultBranchFiles, params); err != nil {
-			panic(err)
-		}
+	if len(defaultBranchFiles) == 0 {
+		panic("No files found for default branch")
+	}
+	if err := generator.GenerateIndex(defaultBranchFiles, params); err != nil {
+		panic(err)
 	}
 
 }