Skip to content

Commit 7047159

Browse files
author
Christopher Giroir
committed
Forcing docs to use the cwd as file base
1 parent b165187 commit 7047159

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/parser.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@
2929
// Accumulate files
3030
this.parse = function(vinyl){
3131
var data = vinyl.contents.toString('utf8');
32+
33+
vinyl.base = vinyl.cwd;
3234
// Don't treat empty files
3335
if (data.length){
34-
filemap[vinyl.path] = data;
35-
dirmap[vinyl.path] = vinyl.cwd;
36+
filemap[vinyl.relative] = data;
37+
dirmap[vinyl.relative] = vinyl.cwd;
3638
}
3739
};
3840

test/expected/hello.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"project":{},"files":{"test/fixtures/hello.txt":{"name":"test/fixtures/hello.txt","modules":{"fixture":1},"classes":{},"fors":{},"namespaces":{}}},"modules":{"fixture":{"name":"fixture","submodules":{},"classes":{},"fors":{},"namespaces":{},"tag":"module","file":"test/fixtures/hello.txt","line":1}},"classes":{},"classitems":[],"warnings":[]}
1+
{"project":{},"files":{"fixtures/hello.txt":{"name":"fixtures/hello.txt","modules":{"fixture":1},"classes":{},"fors":{},"namespaces":{}}},"modules":{"fixture":{"name":"fixture","submodules":{},"classes":{},"fors":{},"namespaces":{},"tag":"module","file":"fixtures/hello.txt","line":1}},"classes":{},"classitems":[],"warnings":[]}

0 commit comments

Comments
 (0)