diff --git a/cmd/cloc.go b/cmd/cloc.go index ec62ee27..d2e5b90c 100644 --- a/cmd/cloc.go +++ b/cmd/cloc.go @@ -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" @@ -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 diff --git a/cmd/config/cmd_config.go b/cmd/config/cmd_config.go index c6294d93..f30ff815 100644 --- a/cmd/config/cmd_config.go +++ b/cmd/config/cmd_config.go @@ -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"