Skip to content

Commit

Permalink
fixing treeDir path
Browse files Browse the repository at this point in the history
  • Loading branch information
SparshithNR committed Jun 5, 2020
1 parent b538e2c commit e729381
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,12 @@ abstract class Filter extends Plugin {
let fileMeta = this.input.readFileMeta(relativePath);
if (typeof e !== 'object') error = new Error('' + e);
error.file = relativePath;
error.treeDir = fileMeta && fileMeta.path;
let treeDir = relativePath;
if (fileMeta) {
let rootRelativeToFilePath = fileMeta.path.replace(relativePath, ''); // remo
treeDir = rootRelativeToFilePath.replace(/\/$/, ''); // remove trailing slash
}
error.treeDir = treeDir;
throw error;
}
}
Expand Down

0 comments on commit e729381

Please sign in to comment.