bubkoo / ascii-progress

🍓 Ascii progress-bar(s) in the terminal.
MIT License
207 stars 21 forks source link

Add null check to avoid breaking when there is no tty #18

Closed rogeriochaves closed 7 years ago

rogeriochaves commented 7 years ago

I'm getting this error when running a code that uses ascii-progress inside docker with no tty attached:

node_modules/ascii-progress/index.js:459
  this.cursor.moveTo(this.savePos.row, this.savePos.col);
                                 ^

TypeError: Cannot read property 'row' of undefined

I believe the issue is that get-cursor-position returns null when you don't have a tty, so I've added a null check in this line.

Probably same reason of #14

rogeriochaves commented 7 years ago

can you publish a new version?

bubkoo commented 7 years ago

@rogeriochaves v1.0.6

Javarome commented 6 years ago

Looks like 1.0.6 is not available

npm install
npm ERR! Darwin 17.7.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/bin/npm-cli.js" "install" "--scripts-prepend-node-path=auto"
npm ERR! node v7.6.0
npm ERR! npm  v4.2.0
npm ERR! code ETARGET

npm ERR! notarget No compatible version found: ascii-progress@^1.0.6
npm ERR! notarget Valid install targets:
npm ERR! notarget 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5