You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
quote, squote and quoteList return quoted pointer value instead of quoted string this pointer points to.
To reproduce
{{- $release := (gitHubLatestRelease "sharkdp/bat").Assets | first -}}
Name: {{ $release.Name }}
Name quote: {{ $release.Name | quote }}
Name quoteList: {{ list $release.Name | quoteList }}
Name type: {{ $release.Name | kindOf }}
Prints:
Name: bat-musl_0.24.0_amd64.deb
Name quoted: '0xc000a841b0'
Name quoteList: ["0xc00078ad80"]
Name type: ptr
Expected behavior
{{ $ptr | quote }} returns quoted {{ $ptr }}. In the meantime "{{ $ptr}}" can be used as a replacement.
Additional context
I know that quote is coming from sprig, quoteListis first party though. sprig is not very well supported and this behaviour can be very confusing for chezmoi users. I guess that's one more reason to replace sprig with something better like proposed in #2668
The text was updated successfully, but these errors were encountered:
KapJI
changed the title
Template function quote doesn't work with pointers
Template function quote doesn't work for pointers
Oct 20, 2024
I have confirmed this. This won't be easy to resolve (there are a number of places where this would need changing, and fixing it would likely require the use of a sprig fork), but even piping through toString fails. This, at a minimum, should be shored up to convert *string to string so that even if something like $ptr | quote won't work because of the difficulties involved, $ptr | toString | quote or list $ptr | toStrings | quoteListabsolutely work.
Thanks for reporting this. #4007 should fix it for quote and quoteList at least. sprig's implementation of squote is hilariously broken, so I don't propose to attempt to fix this.
Describe the bug
quote
,squote
andquoteList
return quoted pointer value instead of quoted string this pointer points to.To reproduce
Prints:
Expected behavior
{{ $ptr | quote }}
returns quoted{{ $ptr }}
. In the meantime"{{ $ptr}}"
can be used as a replacement.Additional context
I know that
quote
is coming fromsprig
,quoteList
is first party though.sprig
is not very well supported and this behaviour can be very confusing for chezmoi users. I guess that's one more reason to replacesprig
with something better like proposed in #2668The text was updated successfully, but these errors were encountered: