-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
gomplate v3.9.0 > "unknown command \"{{\" for \"gomplate\""[0m" on windows #1095
Comments
Hi @adriens, thanks for logging this, and sorry for the delay - it's been a busy week! I'll start with the last question since that's simplest 😉
Keep using the non-
The encoding clearly isn't working right on a Windows terminal. The logging package that gomplate uses emits ANSI colour-coded messages when it thinks it's in an interactive terminal - there are ways to enable ANSI in the Windows terminal, but it's not default. I think the best fix for now is for gomplate to detect if it's running in Windows and avoid using colours then. As for the actual issue with the command not working as expected, I'm not a Windows user so I can't be 100% sure, but I think the problem is simply with quoting. The Windows command prompt doesn't treat Here are some alternate options to try: C:\> gomplate -d person=./person.json -i "Hello {{ (datasource `person`).name }}"
C:\> gomplate -d person=./person.json -i "Hello {{ (datasource \"person\").name }}"
C:\> gomplate -d person=./person.json -i "Hello {{ (datasource ^"person^").name }}" Some explanation:
All that being said, when you're using gomplate "for real" it's a bit more customary to pass through an input file (with |
I managed to get access to a Windows VM, and I found that the first two options ( On second thought, the docs are very UNIX-shell centric, so making all the examples compatible with Windows would be an enormous undertaking. Also, there seems to be a number of different terminals in use for Windows now - the legacy cmd.exe, PowerShell, and Windows Terminal. The latter two seem to support I'm going to leave this as-is, and close this issue. Maybe if someone else runs into this in future, they'll find this issue and recognize that they just need to use appropriate quoting for their shell. |
Hi, I'm giving a try to two ther terminals :
I'll let you know on this ticket. |
Powershell is not a great experience, but the cleanest and simplest approach then is to use a real bash under windows. So I decided to try from Git Bash as most Dev and OPS do have it on their Windows and it works perfeclty well : |
Totally agree 👍
Yep, would make no sens 👌
💯 I would add if other windows users fall on the same issue, ask them to use a proper shell, and that Git bash perfectly does the job. |
Context
While running
gomplate version 3.9.0
on windows and trying the run theperson.json
datasource tutorial I'm not able to properly run the scenario.Please notice I've used the
gomplate_windows-amd64.exe
binary.But when I run the following command :
gomplate -d person=./person.json -i 'Hello {{ (datasource "person").name }}'
I get the following output (looking like something's wrong with the encoding) :
... while everything runs normally on my local vagrant, on the same machine (through brew install) :
I can't figure out what's going wrong or if I used the bad binary ?... should I rather use
gomplate_windows-amd64-slim.exe
?Thank you in advance for your help. Your tools looks perfectly cool to achieve the goals I have.
Kind regards,
Adrien
The text was updated successfully, but these errors were encountered: