Commit e239579
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)
}
}