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

Commit d4a4a52

Browse files
committed
feat: update to go-ipfs v0.4.7
1 parent f08b79b commit d4a4a52

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "go-ipfs-dep",
3-
"version": "0.4.5",
3+
"version": "0.4.7",
44
"description": "Install the latest go-ipfs binary",
55
"go-ipfs": {
6-
"version": "v0.4.5"
6+
"version": "v0.4.7"
77
},
88
"main": "src/index.js",
99
"engines": {
@@ -25,9 +25,9 @@
2525
},
2626
"dependencies": {
2727
"go-platform": "^1.0.0",
28-
"gunzip-maybe": "^1.3.1",
29-
"request": "^2.75.0",
30-
"tar-fs": "^1.13.2",
28+
"gunzip-maybe": "^1.4.0",
29+
"request": "^2.81.0",
30+
"tar-fs": "^1.15.1",
3131
"unzip": "^0.1.11"
3232
},
3333
"keywords": [
@@ -41,10 +41,10 @@
4141
},
4242
"homepage": "https://github.com/ipfs/npm-go-ipfs-dep",
4343
"devDependencies": {
44-
"pre-commit": "^1.1.3",
45-
"rimraf": "^2.5.4",
46-
"standard": "^8.6.0",
44+
"pre-commit": "^1.2.2",
45+
"rimraf": "^2.6.1",
46+
"standard": "^9.0.2",
4747
"tap-spec": "^4.1.1",
48-
"tape": "^4.6.0"
48+
"tape": "^4.6.3"
4949
}
5050
}

src/check-support.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ const supportedVersions = [
2222
'v0.4.2',
2323
'v0.4.3',
2424
'v0.4.4',
25-
'v0.4.5'
25+
'v0.4.5',
26+
'v0.4.6',
27+
'v0.4.7'
2628
]
2729

2830
// Check functions
@@ -31,12 +33,12 @@ const isSupportedPlatform = (platform) => supportedPlatforms.indexOf(platform) !
3133
const isSupportedArch = (arch) => supportedArchs.indexOf(arch) !== -1
3234

3335
// Is the platform Windows?
34-
const isWindows = (os) => {
36+
function isWindows (os) {
3537
return os === 'windows'
3638
}
3739

3840
// Validate the requested binary support, throw en error if not supported
39-
const verify = (version, platform, arch) => {
41+
function verify (version, platform, arch) {
4042
if (!isSupportedArch(arch)) {
4143
throw new Error(`No binary available for arch '${arch}'`)
4244
}

test/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const Download = require('../src')
1111
const version = process.env.TARGET_VERSION || 'v' + pkg.version.replace(/-[0-9]+/, '')
1212

1313
// These tests won't work with promises, wrap the download function to a callback
14-
const download = (version, platform, arch, callback) => {
14+
function download (version, platform, arch, callback) {
1515
if (typeof version === 'function' || !version) {
1616
callback = version || callback
1717
version = null
@@ -34,17 +34,19 @@ const download = (version, platform, arch, callback) => {
3434
})
3535

3636
Download(version, platform, arch)
37-
.then((e) => callback(null, e))
38-
.catch((e) => callback(e))
37+
.then((artifact) => callback(null, artifact))
38+
.catch((err) => callback(err))
3939
}
4040

4141
test('Ensure ipfs gets downloaded (current version and platform)', (t) => {
4242
t.plan(5)
4343
const dir = path.resolve(__dirname, '../go-ipfs')
4444
rimraf.sync(dir)
45+
4546
download((err, res) => {
4647
t.ifErr(err)
4748
t.ok(res.fileName.indexOf(`ipfs_${version}_${goenv.GOOS}-${goenv.GOARCH}`) !== -1, 'Returns the correct filename')
49+
4850
t.ok(res.installPath === path.resolve(__dirname, '../', 'go-ipfs') + '/', 'Returns the correct output path')
4951

5052
fs.stat(dir, (err, stats) => {

0 commit comments

Comments
 (0)