vutran / os-fonts

Retrieve fonts available on your OS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Basic test does not work (`process.env.WIN_DIR` undefined)

niftylettuce opened this issue · comments

You cannot use path with an undefined variable.

λ ~/Public/project/ master* node -i
> require('os-fonts');
TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.join (path.js:1211:7)
    at Object.<anonymous> (/Users/user/Public/project/node_modules/os-fonts/index.js:15:16)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)

This is on OS X, but I'm sure this happens on Linux too and possibly even Windows itself.

WINDIR is a Windows-only environmental variable so running the test in Mac or Linux would cause this error.

The fix should have been fixed here.

Thanks for fixing this and publishing to NPM so quickly.

Np, let me know if you continue to have issues using this module.