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

Commit 521ea24

Browse files
scott113341daviddias
authored andcommitted
feat: use https
* Use HTTPS for download * improved test by removing the go-ipfs directory before testing the download function
1 parent 53f99a1 commit 521ea24

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"homepage": "https://github.com/diasdavid/go-ipfs-dep",
3333
"devDependencies": {
3434
"aegir": "^8.1.2",
35+
"rimraf": "^2.5.4",
3536
"tap-spec": "^4.1.1",
3637
"tape": "^4.6.0"
3738
}

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = function (callback) {
2424

2525
const fileExtension = isWindows ? '.zip' : '.tar.gz'
2626
const fileName = 'ipfs_v' + version + '_' + goenv.GOOS + '-' + goenv.GOARCH + fileExtension
27-
const url = 'http://dist.ipfs.io/go-ipfs/v' + version + '/go-' + fileName
27+
const url = 'https://dist.ipfs.io/go-ipfs/v' + version + '/go-' + fileName
2828
const installPath = path.resolve(__dirname, '..')
2929
const fileStream = request.get(url)
3030

test/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
var test = require('tape')
44
var fs = require('fs')
55
var path = require('path')
6+
var rimraf = require('rimraf')
67

78
var download = require('../src')
89

910
test('Ensure ipfs gets downloaded', function (t) {
1011
t.plan(2)
12+
const dir = path.resolve(__dirname, '../go-ipfs')
13+
rimraf.sync(dir)
1114
download(function () {
12-
fs.stat(path.resolve(__dirname, '../go-ipfs'), function (err, stats) {
15+
fs.stat(dir, function (err, stats) {
1316
t.error(err, 'ipfs bin should stat without error')
1417
t.ok(stats, 'ipfs was downloaded')
1518
})

0 commit comments

Comments
 (0)