jonruttan / delexe

Read in JSON/CSON tokens from a TextMate-style lexical analyser and render the output in a variety of formats.
MIT License
1 stars 1 forks source link

fix(cli): Read from File Path #1

Closed killercup closed 9 years ago

killercup commented 9 years ago

Basically a typo.

I was playing with it and noticed that while reading from stdin works like a charm, there was a problem when reading from a file.

jonruttan commented 9 years ago

Darn, you found it that quickly?!? I had been hoping I would get it fixed before anybody noticed. Your pull request matches the code I'd had there previously. I was working in this area when I found a flaw a little deeper down in the code which I'm in the middle of fixing. I copied the atom/highlights module a little too closely in this area, and filePath is accidentally serving dual purposes, sometimes the name of the input file, and sometimes the output file, and possibly both at the same time. There's also some issues of a similar nature a little deeper down in the jonruttan/last-mate library which I need to root out before this stuff will be stable.

killercup commented 9 years ago

Hehe, no worries! Good thing you told me that I could pipe into delexe or this would've been the first thing I tried ;)

I also had the problem that delexe only writes the plain code when reading from a token file, but maybe I just missed something.

On Tue, May 5, 2015 at 4:01 AM, Jon Ruttan notifications@github.com wrote:

Darn, you found it that quickly?!? I had been hoping I would get it fixed before anybody noticed. Your pull request matches the code I'd had there previously. I was working in this area when I found a flaw a little deeper down in the code which I'm in the middle of fixing. I copied the atom/highlights module a little too closely in this area, and filePath is accidentally serving dual purposes, sometimes the name of the input file, and sometimes the output file, and possibly both at the same time. There's also some issues of a similar nature a little deeper down in the jonruttan/last-mate library which I need to root out before this stuff will be stable.

Reply to this email directly or view it on GitHub: https://github.com/jonruttan/delexe/pull/1#issuecomment-98904173

jonruttan commented 9 years ago

It will auto-detect the output type from the file extension when this bug is fixed. Which reminds me that I haven't filed this as an issue yet..

Until then, you can force a particular output scope using the -s, or scope flag, set it to text.html.plain for html.