Skip to content
This repository was archived by the owner on Aug 12, 2020. It is now read-only.

Commit 77b915e

Browse files
fix: export files with a POSIX path
1 parent 657fdae commit 77b915e

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

src/exporter/dir-flat.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict'
22

3-
const path = require('path')
43
const pull = require('pull-stream')
54
const paramap = require('pull-paramap')
65
const CID = require('cids')
@@ -22,7 +21,7 @@ function dirExporter (node, name, pathRest, ipldResolver, resolve, parent) {
2221
pull.values(node.links),
2322
pull.map((link) => ({
2423
linkName: link.name,
25-
path: path.join(name, link.name),
24+
path: name + '/' + link.name,
2625
hash: link.multihash
2726
})),
2827
pull.filter((item) => accepts === undefined || item.linkName === accepts),

src/exporter/dir-hamt-sharded.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict'
22

3-
const path = require('path')
43
const pull = require('pull-stream')
54
const paramap = require('pull-paramap')
65
const CID = require('cids')
@@ -25,7 +24,7 @@ function shardedDirExporter (node, name, pathRest, ipldResolver, resolve, parent
2524
pull.map((link) => {
2625
// remove the link prefix (2 chars for the bucket index)
2726
const p = link.name.substring(2)
28-
const pp = p ? path.join(name, p) : name
27+
const pp = p ? name + '/' + p : name
2928
let accept = true
3029
let fromPathRest = false
3130

src/exporter/object.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict'
22

3-
const path = require('path')
43
const CID = require('cids')
54
const pull = require('pull-stream')
65
const pullDefer = require('pull-defer')
@@ -10,7 +9,7 @@ module.exports = (node, name, pathRest, ipldResolver, resolve) => {
109
if (pathRest.length) {
1110
const pathElem = pathRest.shift()
1211
newNode = node[pathElem]
13-
const newName = path.join(name, pathElem)
12+
const newName = name + '/' + pathElem
1413
if (CID.isCID(newNode)) {
1514
const d = pullDefer.source()
1615
ipldResolver.get(sanitizeCID(newNode), (err, newNode) => {

0 commit comments

Comments
 (0)