Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Git Directory Generator only matches directories that contain valid Helm/ksonnet/Kustomize artifacts #132

Merged
merged 6 commits into from Mar 2, 2021

Conversation

jgwest
Copy link
Member

@jgwest jgwest commented Feb 19, 2021

See parent issue for details.

Fixes #121

@jgwest jgwest requested a review from wtam2018 February 22, 2021 09:00

repoRoot := gitRepoClient.Root()

if err := filepath.Walk(repoRoot, func(path string, info os.FileInfo, fnErr error) error {
Copy link
Collaborator

@wtam2018 wtam2018 Mar 1, 2021

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.

Copy link
Member Author

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.

@wtam2018 wtam2018 self-requested a review March 1, 2021 22:44
Copy link
Collaborator

@wtam2018 wtam2018 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
@jgwest Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Git Directory Generator only matches directories that contain valid Helm/ksonnet/Kustomize artifacts
3 participants