ruyadorno / ntl

Node Task List: Interactive cli to list and run package.json scripts

Home Page:https://www.npmjs.com/package/ntl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ntl breaks when trying to list only-description tasks + show info

ruyadorno opened this issue · comments

ntl is breaking pretty bad when trying to use a particular combination of options:

In a given project with no task descriptions:

$ ntl -i -o
.../ntl/cli.js:86
const longestScriptName = (scripts) => Object.keys(scripts).reduce((acc, curr) => curr.length > acc.length ? curr : acc).length;
                                                            ^

TypeError: Reduce of empty array with no initial value
    at Array.reduce (<anonymous>)
    at longestScriptName (.../ntl/cli.js:86:61)
    at .../ntl/cli.js:90:57
    at Array.map (<anonymous>)
    at Object.<anonymous> (.../ntl/cli.js:90:25)