noahmorrison / chevron

A Python implementation of mustache
MIT License
486 stars 52 forks source link

process substitution does not work #26

Closed dkrieger closed 6 years ago

dkrieger commented 6 years ago

Process substitution (<(echo "string")) does not work for either DATA or TEMPLATE.

#!/bin/bash
chevron -d <(printf '{"foo":"bar"}') <(printf 'Let'"'"'s go to the {{foo}} after work.')

yields

usage: chevron [-h] [-v] [-d DATA] [-p PARTIALS_PATH] [-e PARTIALS_EXT]
               [-l DEF_LDEL] [-r DEF_RDEL]
               template
chevron: error: The file /dev/fd/63 does not exist!

Same result when replacing either argument with a real file.

Anecdotally, I cannot think of another CLI tool that accepts filenames as input that chokes on process substitution, so I hope this isn't a wontfix situation.

noahmorrison commented 6 years ago

Sorry about that, apparently os.path.isfile returns false on named pipes.

Should be fixed in the latest master.

I need to add a unit test for this too, and push a new version (but finals, so it might be a while).

dkrieger commented 6 years ago

Great news, thanks for the quick action!