SAPikachu / icomoon-build

Build IcoMoon project in Node
MIT License
27 stars 9 forks source link

Bad error message when no path is passed for CSS output #15

Open tambry opened 5 years ago

tambry commented 5 years ago

Using Node 12.6.0:

> npx icomoon-build --css -p .\res\icons.json --fonts dist/
internal/fs/utils.js:426
    throw new ERR_INVALID_ARG_TYPE(propName, ['string', 'Buffer', 'URL'], path);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be one of type string, Buffer, or URL. Received type boolean
    at Object.openSync (fs.js:439:10)
    at Object.writeFileSync (fs.js:1206:35)
    at <my project root>\node_modules\icomoon-build\lib\cli.js:23:20
    at Array.forEach (<anonymous>)
    at <my project root>\node_modules\icomoon-build\lib\cli.js:17:70
    at <my project root>\node_modules\icomoon-build\lib\icomoon.js:104:9
    at ChildProcess.exithandler (child_process.js:288:7)
    at ChildProcess.emit (events.js:203:13)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
tambry commented 5 years ago

Turns out I misread the command line options.

Would be nice if such misusage generated an easy to understand error though. Leaving this open for that.