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

resources.Get and resources.GetMatch failing when used with resources.ByType and resources.Match #12214

Closed
jmooring opened this issue Mar 8, 2024 · 1 comment · Fixed by #12235

Comments

@jmooring
Copy link
Member

jmooring commented Mar 8, 2024

Worked (sort of) in v0.123.7. Fails in v0.123.8.

Related to #12190, but global assets are in subdirectory.

assets/
└── snippets/
    ├── a.txt
    └── b.txt
{{ range resources.ByType "text" }}
  {{ .Name }}
{{ end }}

Expected (v0.123.7) --> /snippets/a.txt (note that in v0.122.0 this returned snippets/a.txt -- no leading slash)

Actual (v0.123.8) --> a.txt

I believe the above is causing both of these to fail (resources are not published):

{{ with resources.ByType "text" }}
  {{ with .Get "snippets/a.txt" }}
    {{ .Publish }}
  {{ end }}
{{ end }}

{{ with resources.Match "**" }}
  {{ with .GetMatch "snippets/b.txt" }}
    {{ .Publish }}
  {{ end }}
{{ end }}
@jmooring jmooring changed the title resources.ByType and resources.Match have incorrect .Name resources.ByType and resources.Match failing when used with resources.ByType and resources.Match Mar 8, 2024
@jmooring jmooring changed the title resources.ByType and resources.Match failing when used with resources.ByType and resources.Match resources.Get and resources.GetMatch failing when used with resources.ByType and resources.Match Mar 8, 2024
@bep bep self-assigned this Mar 13, 2024
@bep bep modified the milestones: v0.124.0, v0.123.9 Mar 13, 2024
Copy link

github-actions bot commented Apr 4, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants