-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
Recursive globs behaviour has changed #256
Comments
The previous behavior was "wrong"... you can try it with
I will make this change clearer on the release notes though. |
Hm, I thought so too at first (that $ tree
.
├── a
│ └── b
│ └── f1
├── c
│ └── f2
└── f3
3 directories, 3 files
$ cat ./**/*
cat: ./a: Is a directory
cat: ./a/b: Is a directory
f1
cat: ./c: Is a directory
f2
f3
$ echo $SHELL
/bin/zsh
$ /bin/zsh --version
zsh 5.7.1 (x86_64-apple-darwin19.0) So could indeed be a bug in https://github.com/gobwas/glob that we mistook for a feature. |
They probably would match |
This indeed seems to be what's happening: https://play.golang.org/p/geU9afuijny There is also a closed issue for this (gobwas/glob#20). It seems like gobwas thinks that the current behaviour is correct. I made a new issue though: gobwas/glob#46 |
yeah, makes sense @erikgeiser 🤔 |
Maybe we could hack around it and replace |
Ah, I thought I tried I'll switch to that and upgrade us back. |
TIL: PEBCAK 🤣 |
I'm not sure any solution is right. There seem to be so many glob variants that behave differently in these exact cases. This behavior is also configurable in many shells. We probably just have to decide on a behavior we like. Just hacking around on the pattern before compiling does not seem like a good long term solution through. |
Maybe forking is a good workaround for now? |
First we need to decide what we'll do exactly. We can't really rely on shell behaviour because shell globbing behaviour is also configurable in most shells. My $ tree
.
├── a
│ └── b
│ └── f1
├── c
│ └── f2
└── f3
3 directories, 3 files
$ cat ./**
cat: ./a: Is a directory
cat: ./c: Is a directory
f3 To fix this issue here ( |
I would say if they don't want the changes back, either that or leave as-is. So far only this issue was opened about this behavior change, so I would say its probably not too bad to leave as-is.... |
You can now add directories (as long as some files exist in a nested directory) without needing globbing https://github.com/goreleaser/nfpm/blob/master/files/files_test.go#L71 contents:
- src: testdata/deep-paths/
dst: /bla |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
See #232 (comment)
The text was updated successfully, but these errors were encountered: