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
Not sure if this is a user error, expected behaviour or a bug but I just thought I'd create an issue as I couldn't find an answer to this anywhere else.
Given the following template stencil
{% for class in types.classes|annotated:"ImmutableConvertibleType" %}
{% set structName %}{{ class.name }}Struct{% endset %}
// sourcery:file:Model/{{ structName }}Struct.swift
struct {{ structName }} {}
// sourcery:end
{% endfor %}
If I run this with sourcery --watch, every time I modify/save the template, a new copy of the rendered text is appended to my output. So I end up with a file like this:
// Generated using Sourcery 0.16.0 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT
struct ArticleStruct {}
struct ArticleStruct {}
struct ArticleStruct {}
struct ArticleStructABC {}
...etc
Interestingly, if I don't specify the output file with // sourcery:file:Model/{{ structName }}Struct.swift, it works as expected and the rendered text replaces the previous version.
Also if I run sourcery as a one-off command without --watch, it also works as expected.
Is this a bug or am I missing something?
Thanks!
Rog
The text was updated successfully, but these errors were encountered:
Not sure if this is a user error, expected behaviour or a bug but I just thought I'd create an issue as I couldn't find an answer to this anywhere else.
Given the following template stencil
If I run this with
sourcery --watch
, every time I modify/save the template, a new copy of the rendered text is appended to my output. So I end up with a file like this:Interestingly, if I don't specify the output file with
// sourcery:file:Model/{{ structName }}Struct.swift
, it works as expected and the rendered text replaces the previous version.Also if I run
sourcery
as a one-off command without--watch
, it also works as expected.Is this a bug or am I missing something?
Thanks!
Rog
The text was updated successfully, but these errors were encountered: