Skip to content

Commit

Permalink
feat: create cloc dir
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Sep 16, 2020
1 parent a9b47cb commit 1277209
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/cloc.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var clocCmd = &cobra.Command{
dirs = append(dirs, filepath.FromSlash(args[0] + "/" + f.Name()))
}
}
os.Mkdir(config.CocaConfig.ReporterPath + "/cloc/", os.ModePerm)
createClocDir()

processor.Format = "json"

Expand All @@ -63,6 +63,10 @@ var clocCmd = &cobra.Command{
},
}

func createClocDir() error {
return os.Mkdir(config.CocaConfig.ReporterPath+"/cloc/", os.ModePerm)
}

func process_dirs(dirs []string) []string {
var outputFiles []string

Expand Down
2 changes: 2 additions & 0 deletions cmd/config/cmd_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package config

type TypeCocaConfig struct {
ReporterPath string
ClocDir string
}

var CocaConfig = &TypeCocaConfig{
ReporterPath: "coca_reporter",
ClocDir: "/cloc",
}

const VERSION = "2.0.0"

0 comments on commit 1277209

Please sign in to comment.