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

fix: Windows interop #104

Merged
merged 13 commits into from
Nov 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
environment:
matrix:
- nodejs_version: "6"
- nodejs_version: "8"

# cache:
# - node_modules

platform:
- x64

install:
- ps: Install-Product node $env:nodejs_version $env:platform
- npm install

test_script:
- node --version
- npm --version
- npm test

build: off

version: "{build}"
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
"homepage": "https://github.com/ipld/js-ipld-resolver#readme",
"license": "MIT",
"devDependencies": {
"aegir": "^12.0.8",
"aegir": "^12.1.3",
"chai": "^4.1.2",
"dirty-chai": "^2.0.1",
"eth-hash-to-cid": "^0.1.0",
"eth-hash-to-cid": "~0.1.0",
"ethereumjs-block": "^1.7.0",
"lodash": "^4.17.4",
"ncp": "^2.0.0",
Expand All @@ -46,20 +46,20 @@
"dependencies": {
"async": "^2.5.0",
"cids": "~0.5.2",
"interface-datastore": "^0.3.1",
"ipfs-block": "~0.6.0",
"ipfs-block-service": "~0.12.0",
"ipfs-repo": "~0.17.0",
"interface-datastore": "~0.4.1",
"ipfs-block": "~0.6.1",
"ipfs-block-service": "~0.13.0",
"ipfs-repo": "~0.18.2",
"ipld-dag-cbor": "~0.11.1",
"ipld-dag-pb": "~0.11.2",
"ipld-ethereum": "^1.4.3",
"ipld-git": "^0.1.0",
"ipld-git": "~0.1.0",
"ipld-raw": "^1.0.6",
"is-ipfs": "~0.3.2",
"lodash.flatten": "^4.4.0",
"lodash.includes": "^4.3.0",
"memdown": "^1.4.1",
"multihashes": "~0.4.9",
"multihashes": "~0.4.12",
"pull-sort": "^1.0.1",
"pull-stream": "^3.6.1",
"pull-traverse": "^1.0.3"
Expand Down
7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const doUntil = require('async/doUntil')
const IPFSRepo = require('ipfs-repo')
const BlockService = require('ipfs-block-service')
const joinPath = require('path').join
const osPathSep = require('path').sep
const pullDeferSource = require('pull-defer').source
const pullTraverse = require('pull-traverse')
const map = require('async/map')
Expand Down Expand Up @@ -116,8 +117,12 @@ class IPLDResolver {

// this removes occurrences of ./, //, ../
// makes sure that path never starts with ./ or /
// path.join is OS specific. Need to convert back to POSIX format.
if (typeof path === 'string') {
path = joinPath('/', path).substr(1)
path = joinPath('/', path)
.substr(1)
.split(osPathSep)
.join('/')
}

if (path === '' || !path) {
Expand Down
3 changes: 2 additions & 1 deletion test/ipld-eth.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ module.exports = (repo) => {

let ethObjs

before((done) => {
before(function (done) {
this.timeout(10 * 1000)
const bs = new BlockService(repo)
resolver = new IPLDResolver(bs)

Expand Down