Git Directory Generator only matches directories that contain valid Helm/ksonnet/Kustomize artifacts #132
Conversation
…elm/ksonnet/Kustomize artifacts
…elm/ksonnet/Kustomize artifacts
…elm/ksonnet/Kustomize artifacts
…elm/ksonnet/Kustomize artifacts
…elm/ksonnet/Kustomize artifacts
47f78e7
to
8b94650
Compare
…elm/ksonnet/Kustomize artifacts
|
||
repoRoot := gitRepoClient.Root() | ||
|
||
if err := filepath.Walk(repoRoot, func(path string, info os.FileInfo, fnErr error) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you considered calling LsFiles
and then use filepath.Base() to only keep directores? We won't have to explictly skip "." and .git.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wtam2018 - Good thinking, and actually I tried this approach first: the problem is that LsFiles
doesn't list directories, only files, and there doesn't seem to be a switch to enable it show directories (see man git-ls-files
). LsFiles
is just a minimal wrapper around the git ls-files --full-name -- (path to repo)
command, which you can try yourself on a local repo to see that it only lists files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@jgwest Thanks!
See parent issue for details.
Fixes #121