fixing bug with config generation, started fixing add command, next commit command

This commit is contained in:
2020-07-04 22:05:02 -04:00
parent 5af55ed62e
commit c07e09d155
10 changed files with 256 additions and 44 deletions

View File

@@ -150,6 +150,7 @@ func AddFiles(input string, inputType string, ignore common.FileTypes, m *engine
m.Info().Msg("Adding all files...")
filepath.Walk(workingDir, func(path string, info os.FileInfo, err error) error {
if err != nil {
fmt.Println("Err accessing path: ", err)
return fmt.Errorf("failure accessing path %s", err)
}
if info.IsDir() {
@@ -178,9 +179,12 @@ func AddFiles(input string, inputType string, ignore common.FileTypes, m *engine
if relativePath == "." { //Ignoring current directory
return nil
}
fmt.Println("Adding file to repo: ", path)
m.Info().Msgf("Adding file to repo: %s", path)
err = m.AddFileToRepo(relativePath)
if err != nil {
return fmt.Errorf("unable to add file to repo: %s", err)
fmt.Printf("unable to add file to repo: %s\n", err)
return nil
}
trackedFiles = append(trackedFiles, relativePath)
return nil