Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/tool/file: Replace filepath.Glob with doublestar.FilepathGlob #1920

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fionera
Copy link

@fionera fionera commented Sep 10, 2022

The Go stdlib implements Glob with Match as its base and does not support the double star syntax. To allow recursive lists via file.Glob it should be supported.

command: test: {
	task: {
		list: file.Glob & {
			glob: "charts/bitnami/mysql/**/*.yaml"
		}

		print: cli.Print & {
			text: strings.Join(list.files, "\n")
		}
	}
}

Current behaviour:

charts/bitnami/mysql/templates/extra-list.yaml
charts/bitnami/mysql/templates/metrics-svc.yaml
charts/bitnami/mysql/templates/networkpolicy.yaml
charts/bitnami/mysql/templates/prometheusrule.yaml
charts/bitnami/mysql/templates/role.yaml
charts/bitnami/mysql/templates/rolebinding.yaml
charts/bitnami/mysql/templates/secrets.yaml
charts/bitnami/mysql/templates/serviceaccount.yaml
charts/bitnami/mysql/templates/servicemonitor.yaml

New behaviour:

charts/bitnami/mysql/Chart.yaml
charts/bitnami/mysql/values.yaml
charts/bitnami/mysql/templates/extra-list.yaml
charts/bitnami/mysql/templates/metrics-svc.yaml
charts/bitnami/mysql/templates/networkpolicy.yaml
charts/bitnami/mysql/templates/prometheusrule.yaml
charts/bitnami/mysql/templates/role.yaml
charts/bitnami/mysql/templates/rolebinding.yaml
charts/bitnami/mysql/templates/secrets.yaml
charts/bitnami/mysql/templates/serviceaccount.yaml
charts/bitnami/mysql/templates/servicemonitor.yaml
charts/bitnami/mysql/templates/primary/configmap.yaml
charts/bitnami/mysql/templates/primary/initialization-configmap.yaml
charts/bitnami/mysql/templates/primary/pdb.yaml
charts/bitnami/mysql/templates/primary/statefulset.yaml
charts/bitnami/mysql/templates/primary/svc-headless.yaml
charts/bitnami/mysql/templates/primary/svc.yaml
charts/bitnami/mysql/templates/secondary/configmap.yaml
charts/bitnami/mysql/templates/secondary/pdb.yaml
charts/bitnami/mysql/templates/secondary/statefulset.yaml
charts/bitnami/mysql/templates/secondary/svc-headless.yaml
charts/bitnami/mysql/templates/secondary/svc.yaml

Fixes #1919

The Go stdlib implements Glob with Match as its base and does not support the double star syntax. To allow recursive lists via file.Glob it should be supported.

Signed-off-by: Fionera <fionera@fionera.de>
@fionera fionera force-pushed the feat/resolve-doublestar-globs branch from 01fa860 to 55ed05c Compare September 13, 2022 20:20
@mvdan mvdan added the Discuss Requires maintainer discussion label Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discuss Requires maintainer discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

file.Glob: Replace stdlib Glob to support double star syntax
2 participants