@@ -214,7 +214,7 @@ func WriteBrevFile(t *terminal.Terminal, deps []string, gitURL string, path stri
214214 t .Vprint (t .Yellow (strings .Join (deps , " \n " )))
215215 shellString := GenerateShellScript (path )
216216 fmt .Println (GenerateLogs (shellString ))
217- mderr := os .MkdirAll (filepath .Join (path , ".brev" ), os . ModePerm )
217+ mderr := os .MkdirAll (filepath .Join (path , ".brev" ), 0o750 )
218218 if mderr == nil {
219219 // generate a string that is the collections.Concatenation of dependency-ordering the contents of all the dependencies
220220 // found by cat'ing the directory generated from the deps string, using the translated ruby code with go generics
@@ -481,11 +481,8 @@ func nodeVersion(path string) *string {
481481 paths := recursivelyFindFile ([]string {"package\\ -lock\\ .json$" , "package\\ .json$" }, path )
482482 retval := ""
483483 if len (paths ) > 0 {
484-
485484 sort .Strings (paths )
486-
487485 i := len (paths ) - 1
488-
489486 keypath := "engines.node"
490487 jsonstring , _ := files .CatFile (paths [i ])
491488 value := gjson .Get (jsonstring , keypath )
@@ -503,20 +500,15 @@ func gatsbyVersion(path string) *string {
503500 retval := ""
504501 var foundGatsby bool
505502 if len (paths ) > 0 {
506-
507503 sort .Strings (paths )
508504 for _ , path := range paths {
509505 keypath := "dependencies.gatsby"
510- jsonstring , err := files .CatFile (path )
506+ jsonstring , _ := files .CatFile (path )
511507 value := gjson .Get (jsonstring , keypath )
512508
513- if err != nil {
514- //
515- }
516509 if value .String () != "" {
517510 foundGatsby = true
518511 }
519-
520512 }
521513 if foundGatsby {
522514 return & retval
@@ -530,17 +522,13 @@ func goVersion(path string) *string {
530522 paths := recursivelyFindFile ([]string {"go\\ .mod" }, path )
531523
532524 if len (paths ) > 0 {
533-
534525 sort .Strings (paths )
535526 for _ , path := range paths {
536527 fmt .Println (path )
537- res , err := readGoMod (path )
538- if err != nil {
539- //
540- }
528+ res , _ := readGoMod (path )
529+
541530 return & res
542531 }
543-
544532 }
545533 return nil
546534}
@@ -564,24 +552,14 @@ func recursivelyFindFile(filenames []string, path string) []string {
564552 for _ , f := range files {
565553 dir , err := os .Stat (appendPath (path , f .Name ()))
566554 if err != nil {
567- // fmt.Println(t.Red(err.Error()))
568555 } else {
569556 for _ , filename := range filenames {
570557
571558 r , _ := regexp .Compile (filename )
572559 res := r .MatchString (f .Name ())
573560
574561 if res {
575- // t.Vprint(t.Yellow(filename) + "---" + t.Yellow(path+f.Name()))
576562 paths = append (paths , appendPath (path , f .Name ()))
577-
578- // fileContents, err := catFile(appendPath(path, f.Name()))
579- // if err != nil {
580- // //
581- // }
582-
583- // TODO: read
584- // if file has json, read the json
585563 }
586564 }
587565
@@ -590,9 +568,7 @@ func recursivelyFindFile(filenames []string, path string) []string {
590568 }
591569 }
592570 }
593-
594571 // TODO: make the list collections.Unique
595-
596572 return paths
597573}
598574
0 commit comments