tmrts / boilr

:zap: boilerplate template manager that generates files or directories from template repositories
Apache License 2.0
1.72k stars 118 forks source link

non deterministic template saving #29

Open Aluriak opened 8 years ago

Aluriak commented 8 years ago

It seems that my boilr template save . python -f is not deterministic: follows a terminal session. I don't change any files during the session.

lucas@host:~/boilr-python-template➤ alias m='~/bin/boilr template save . python -f'
lucas@host:~/boilr-python-template➤ m
[✘] validate: template: LICENSE:1:6: executing "LICENSE" at <eq License "Apache S...>: error calling eq: incompatible types for comparison
lucas@host:~/boilr-python-template➤ m
[✔] Successfully saved the template python
lucas@host:~/boilr-python-template➤ m
[✘] validate: template: LICENSE:1:6: executing "LICENSE" at <eq License "Apache S...>: error calling eq: incompatible types for comparison
lucas@host:~/boilr-python-template➤ m
[✔] Successfully saved the template python
lucas@host:~/boilr-python-template➤ m
[✘] validate: template: LICENSE:1:6: executing "LICENSE" at <eq License "Apache S...>: error calling eq: incompatible types for comparison
lucas@host:~/boilr-python-template➤ m
[✘] validate: template: LICENSE:1:6: executing "LICENSE" at <eq License "Apache S...>: error calling eq: incompatible types for comparison
lucas@host:~/boilr-python-template➤ m
[✔] Successfully saved the template python

The error here is raised on this line, and should not (i think) appear while License is defined as string.

What am i missing ?

tmrts commented 8 years ago

@Aluriak can you reproduce it with the boilr-license template listed here?

Also feel free to add your own template to the wiki (it's editable to public).

Aluriak commented 8 years ago

No, i can't:

lucas@host➤ git clone https://github.com/tmrts/boilr-license
# ...
lucas@host➤ cd boilr-license && ls
project.json  README.md  template
lucas@host/boilr-license➤ alias m='~/bin/boilr template save . python -f'
lucas@host/boilr-license➤ m
[✔] Successfully saved the template python
lucas@host/boilr-license➤ m
[✔] Successfully saved the template python
lucas@host/boilr-license➤ m
[✔] Successfully saved the template python
lucas@host/boilr-license➤ m
[✔] Successfully saved the template python
# ... ten more repeated lines

I will eventually try to reduce my template to a minimal maybe-working code.

Can you reproduce the problem with my template ?

I will add my template to the wiki once it will be good to me.

tmrts commented 8 years ago

I'm putting a reference to your template that causes this behavior in boilr, so that its not lost when you minimize the template (Aluriak/boilr-python@74a3984492a949c442eb00a9d9418fefb61a207c)

I'm about to turn off for the night. But, I'll examine the template as soon as I can and see where the problematic behavior is coming from :+1:

tmrts commented 7 years ago

I narrowed down the cause to the text/template library, but I'm not going to focus on this specifically, due to not enough information and due to the fact that there is an ongoing overhaul for the boilr templating system.

Feel free to comment if you encounter this issue elsewhere or if you've located the cause