kriskbx / gitlab-time-tracker

šŸ¦ŠšŸ•˜ A command line interface for GitLab's time tracking feature.
GNU General Public License v2.0
458 stars 82 forks source link

gtt config throws error when EDITOR variable is not set #96

Open husim0 opened 5 years ago

husim0 commented 5 years ago

Hello :-)

On my config, EDITOR is not set.

$ gtt config
child_process.js:207
    throw new ERR_INVALID_ARG_VALUE('args', arguments[pos]);
    ^

TypeError [ERR_INVALID_ARG_VALUE]: The argument 'args' is invalid. Received { env:
   { GS_LIB: '/home/hugo/.fonts',
     KDE_FULL_SESSION: 'true',
     LS_COLORS:
      'no=00:fi=00:di=01;34:ln=00;36:pi=...
    at Object.execFile (child_process.js:207:11)
    at Object.childProcess.execFile (pkg/prelude/bootstrap.js:1420:30)
    at Object.exec (child_process.js:148:18)
    at childProcess.exec (pkg/prelude/bootstrap.js:1434:26)
    at open (/snapshot/gitlab-time-tracker/node_modules/open/lib/open.js:58:10)
    at Function.open (/snapshot/gitlab-time-tracker/src/include/filesystem.js:0:0)
    at Object.<anonymous> (/snapshot/gitlab-time-tracker/src/gtt-config.js:0:0)
    at Module._compile (pkg/prelude/bootstrap.js:1254:22)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:711:10)
    at Module.load (internal/modules/cjs/loader.js:610:32)

Setting EDITOR works.

EDITOR=nano gtt config
Pablohn26 commented 4 years ago

Using docker version EDITOR variable is set here and this issue cannot be reproduced. This issue shows up when you are using compiled version gtt-linux in distros like Ubuntu 18.04 that does not have by default environment variables VISUAL and EDITOR of this commit.