diff options
Diffstat (limited to 'goSrcScan.go')
| -rw-r--r-- | goSrcScan.go | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/goSrcScan.go b/goSrcScan.go index 1879a1b..6670259 100644 --- a/goSrcScan.go +++ b/goSrcScan.go @@ -50,6 +50,8 @@ func (f *Forge) ScanGoSrc() (bool, error) { // not stupid like my old version func gitDirectoriesNew(srcDir string) ([]string, error) { var all []string + var trip bool + reposfile := filepath.Join(srcDir, "repos.pb") err := filepath.WalkDir(srcDir, func(path string, d os.DirEntry, err error) error { if err != nil { // Handle possible errors, like permission issues @@ -60,7 +62,13 @@ func gitDirectoriesNew(srcDir string) ([]string, error) { if d.IsDir() { // log.Info("path is dir", path) } else { - log.Info("warning: you have an untracked file:", path) + if path == reposfile { + // ignore repos.pb // todo: also ignore go.work // add config option to not warn about this + } else { + // todo: figure out a way to do padding for init() + log.Info("WARNING: you have an untracked file outside of any .git repository:", path) + trip = true + } return nil } @@ -72,6 +80,20 @@ func gitDirectoriesNew(srcDir string) ([]string, error) { } return nil }) + // + // probably always leave this here forever + // this check, along with CheckDirty() makes sure you can safely delete ~/go/src or the go.work directory + // because everything is either checked in or deleted. An important thing to know! + if trip { + log.Info("WARNING:") + log.Info("WARNING: there isn't a way to disable this warning yet") + log.Info("WARNING: probably this is a good thing however. you don't want to leave files outside of git repos here") + log.Info("WARNING: so this warning should probably stay") + log.Info("WARNING:") + log.Info("WARNING: this also might mean you put these files here because you are actively working on them") + log.Info("WARNING: and you don't want to forget about them") + log.Info("WARNING:") + } return all, err } |
