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-1 to 0.4.3-2

circle.yml

8

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

@@ -8,2 +8,4 @@ "main": "src/index.js",

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

@@ -19,3 +21,4 @@ },

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

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

"devDependencies": {
"aegir": "^8.1.2",
"tap-spec": "^4.1.1",

@@ -35,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 = 'http://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 @@ }

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