diff --git a/lib/filesystem.js b/lib/filesystem.js index d921c50..90fbf2a 100644 --- a/lib/filesystem.js +++ b/lib/filesystem.js @@ -131,9 +131,13 @@ class Filesystem { return files } - getNode (p) { + getNode (p, followLinks) { + followLinks = typeof followLinks === 'undefined' ? true : followLinks const node = this.searchNodeFromDirectory(path.dirname(p)) const name = path.basename(p) + if (node.link && followLinks) { + return this.getNode(path.join(node.link, name)) + } if (name) { return node.files[name] } else { @@ -143,7 +147,7 @@ class Filesystem { getFile (p, followLinks) { followLinks = typeof followLinks === 'undefined' ? true : followLinks - const info = this.getNode(p) + const info = this.getNode(p, followLinks) if (!info) { throw new Error(`"${p}" was not found in this archive`)