Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

go-ipfs-dep

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

go-ipfs-dep - npm Package Compare versions

Comparing version 0.4.3 to 0.4.4

circle.yml

11

package.json
{
"name": "go-ipfs-dep",
"version": "0.4.3",
"version": "0.4.4",
"description": "Install the latest go-ipfs binary",

@@ -8,7 +8,6 @@ "main": "src/index.js",

"install": "node src/bin.js",
"lint": "aegir-lint",
"coverage": "aegir-coverage",
"test": "tape test/*.js | tap-spec"
},
"bin": {
"ipfs": "go-ipfs/ipfs"
},
"repository": {

@@ -22,3 +21,4 @@ "type": "git",

"request": "^2.75.0",
"tar-fs": "^1.13.2"
"tar-fs": "^1.13.2",
"unzip": "^0.1.11"
},

@@ -36,2 +36,3 @@ "keywords": [

"devDependencies": {
"rimraf": "^2.5.4",
"tap-spec": "^4.1.1",

@@ -38,0 +39,0 @@ "tape": "^4.6.0"

#!/usr/bin/env node
'use strict'
require('./')()
'use strict'
var checkPlatform = require('./checkPlatform')
var goenv = require('go-platform')
var gunzip = require('gunzip-maybe')
var path = require('path')
var goenv = require('go-platform')
var version = require('./../package.json').version
var request = require('request')
var gunzip = require('gunzip-maybe')
var tarFS = require('tar-fs')
var unzip = require('unzip')
var version = require('./../package.json').version
module.exports = function (callback) {
callback = callback || noop
checkPlatform(goenv) // make sure we can do this.
// make sure we can do this.
if (!checkPlatform.isSupportedArchitecture(goenv.GOARCH)) {
throw new Error('no binary available for arch: ' + goenv.GOARCH)
}
const isWindows = checkPlatform.isWindows(goenv.GOOS)
// hacky hack hack to work around unpublishability
version = version.replace(/-[0-9]+/, '')
var filename = 'ipfs_v' + version + '_' + goenv.GOOS + '-' + goenv.GOARCH + '.tar.gz'
var url = 'http://dist.ipfs.io/go-ipfs/v' + version + '/go-' + filename
const fileExtension = isWindows ? '.zip' : '.tar.gz'
const fileName = 'ipfs_v' + version + '_' + goenv.GOOS + '-' + goenv.GOARCH + fileExtension
const url = 'https://dist.ipfs.io/go-ipfs/v' + version + '/go-' + fileName
const installPath = path.resolve(__dirname, '..')
const fileStream = request.get(url)
var installPath = path.resolve(__dirname, '..')
request
.get(url)
.pipe(gunzip())
if (isWindows) {
fileStream.pipe(
unzip.Extract({ path: installPath })
.on('close', callback))
} else {
fileStream.pipe(gunzip())
.pipe(

@@ -30,22 +42,2 @@ tarFS

)
function checkPlatform (goenv) {
switch (goenv.GOOS) {
case 'darwin':
case 'linux':
case 'freebsd':
break
default:
throw new Error('no binary available for os:' + goenv.GOOS)
}
switch (goenv.GOARCH) {
case 'amd64':
case '386':
case 'arm':
break
default:
throw new Error('no binary available for arch: ' + goenv.GOARCH)
}
}

@@ -52,0 +44,0 @@ }

@@ -6,2 +6,3 @@ 'use strict'

var path = require('path')
var rimraf = require('rimraf')

@@ -12,4 +13,6 @@ var download = require('../src')

t.plan(2)
const dir = path.resolve(__dirname, '../go-ipfs')
rimraf.sync(dir)
download(function () {
fs.stat(path.resolve(__dirname, '../go-ipfs'), function (err, stats) {
fs.stat(dir, function (err, stats) {
t.error(err, 'ipfs bin should stat without error')

@@ -16,0 +19,0 @@ t.ok(stats, 'ipfs was downloaded')

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc