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

Glob error when copying files with brackets in the name: '[show].js.nft.json' #2946

Closed
2 tasks done
jsirianni opened this issue Mar 1, 2022 · 5 comments · Fixed by #2947
Closed
2 tasks done

Glob error when copying files with brackets in the name: '[show].js.nft.json' #2946

jsirianni opened this issue Mar 1, 2022 · 5 comments · Fixed by #2947
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jsirianni
Copy link

What happened?

Fail to copy a directory that has weird file names (file names with brackets)

config snippet from Goreleaser

  - src: 'build/app/.next'
    dst: /opt/.next

Error

   ⨯ release failed after 5.24s error=nfpm failed: glob failed: build/app/.next/server/pages/[show].html: no matching files

The files it is complaining about

ls build/app/.next/server/pages

install.html   install.js.nft.json  '[show].html'  '[show].js.nft.json'

It seems the brackets in the file name is tripping up nfpm. Unfortunately, I do not have control over the file names.

How can we reproduce this?

Attempt to build a package with a source directory containing files with brackets in the name.

nfpm version

Goreleaser v1.5.0, so it should be nfpm v2.13.0.

Search

  • I did search for other open and closed issues before opening this.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Additional context

No response

@jsirianni jsirianni added the bug Something isn't working label Mar 1, 2022
@djgilcrease
Copy link

try adding disable_globbing: true

@caarlos0
Copy link
Member

caarlos0 commented Mar 1, 2022

I just tested this with plain nfpm, and it works... so it must be something on goreleaser...

caarlos0 referenced this issue in goreleaser/nfpm Mar 1, 2022
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
@caarlos0
Copy link
Member

caarlos0 commented Mar 1, 2022

can confirm this only happens through goreleaser, for some reason

@caarlos0
Copy link
Member

caarlos0 commented Mar 1, 2022

OK, I know why: each packager runs Validate, which does the glob expanding, but we also do it on on goreleaser, so, validate is being called 2 times, the first resolves the globs, the second tried to resolve them again...

will move the issue and fix it there.

@caarlos0 caarlos0 transferred this issue from goreleaser/nfpm Mar 1, 2022
caarlos0 added a commit that referenced this issue Mar 1, 2022
The nfpm pipe was globbing the input list, and then globbing its result
as well. If you add a folder that had a file with, say `[]`, in it, it
would later fail the release upon trying to evaluate that as a glob.

This is probably some faulty nFPM update in which I should have removed
that but didn't.

Either way, this should fix it.

closes #2946
caarlos0 added a commit that referenced this issue Mar 1, 2022
The nfpm pipe was globbing the input list, and then globbing its result
as well. If you add a folder that had a file with, say `[]`, in it, it
would later fail the release upon trying to evaluate that as a glob.

This is probably some faulty nFPM update in which I should have removed
that but didn't.

Either way, this should fix it.

closes #2946
@caarlos0 caarlos0 added this to the v1.6.0 milestone Mar 1, 2022
@jsirianni
Copy link
Author

Appreciate the fast fix, this will let me implement my work without my workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants