marionebl / svg-term-cli

Share terminal sessions via SVG and CSS
MIT License
3.48k stars 116 forks source link

[cli.js:273] TypeError: Path must be a string #2

Closed mathiasbynens closed 6 years ago

mathiasbynens commented 6 years ago
$ npx -p svg-term-cli svg-term --cast=rfS1M5ynKm1hGaBqJYJj0mGCi --out --frame demo.svg
~/.npm/_npx/4272/lib/node_modules/svg-term-cli/lib/cli.js:273
            throw err;
            ^

TypeError: Path must be a string. Received true
    at assertPath (path.js:28:11)
    at resolve (path.js:1186:7)
    at resolvePath (~/.npm/_npx/4272/lib/node_modules/svg-term-cli/node_modules/@marionebl/sander/dist/sander.cjs.js:14:22)
    at normaliseArguments$2 (~/.npm/_npx/4272/lib/node_modules/svg-term-cli/node_modules/@marionebl/sander/dist/sander.cjs.js:363:47)
    at Object.writeFile (~/.npm/_npx/4272/lib/node_modules/svg-term-cli/node_modules/@marionebl/sander/dist/sander.cjs.js:368:13)
    at ~/.npm/_npx/4272/lib/node_modules/svg-term-cli/lib/cli.js:106:20
    at Generator.next (<anonymous>)
    at fulfilled (~/.npm/_npx/4272/lib/node_modules/svg-term-cli/lib/cli.js:5:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
mathiasbynens commented 6 years ago

Never mind, the order was incorrect:

npx -p svg-term-cli svg-term --cast=rfS1M5ynKm1hGaBqJYJj0mGCi --frame --out demo.svg

🌴

marionebl commented 6 years ago

Yep, I tightened the flag checks a bit further to spare users from parsing Node.js stack traces.

As of 1.0.3 the behaviour for the original command is:

npx -p svg-term-cli svg-term --cast=rfS1M5ynKm1hGaBqJYJj0mGCi --out --frame demo.svg

[help text here]

 svg-term: out expected to be string, received "true"