isaacs/node-glob — Issue #31: 3.0.1: CWD is stripped from glob results when pattern starts with /
Author: papandreou
Created: 2012-01-19 08:18:11+00:00
State: open

The current working directory shouldn't be relevant when globbing an absolute path, but:

andreas@ubuntu:~$ npm install glob@3.0.1
[...]
andreas@ubuntu:~$ node
> require('glob').sync('/home/andreas/foo');
[ 'foo' ]

Same thing happens when the pattern contains wildcards.

It worked fine in previous versions:

andreas@ubuntu:~$ npm install glob@2.0.9
[...]
andreas@ubuntu:~$ node
> require('glob').sync('/home/andreas/foo');
[ '/home/andreas/foo/' ]