Comparing version 0.3.0 to 0.3.2
@@ -9,6 +9,7 @@ #!/usr/bin/env node | ||
var extract = require('extract-zip') | ||
var version = require('./package.json').version | ||
checkPlatform(goenv) // make sure we can do this. | ||
var filename = 'ipfs_master_' + goenv.GOOS + '-' + goenv.GOARCH + '.zip' | ||
var filename = 'ipfs_v'+ version +'_' + goenv.GOOS + '-' + goenv.GOARCH + '.zip' | ||
var url = 'https://gobuilder.me/get/github.com/ipfs/go-ipfs/cmd/ipfs/' + filename | ||
@@ -19,14 +20,25 @@ | ||
var installPath = path.join(bin, 'ipfs') | ||
var zipfile = path.join(tmp, filename) | ||
// mk tmp dir | ||
mkdirp(tmp, function(err) { | ||
if (err) onerror(err) | ||
// download binary | ||
nugget(url, {target: filename, dir: tmp, resume: true, verbose: true}, function (err) { | ||
if (err) return onerror(err) | ||
extract(path.join(tmp, filename), {dir: tmp}, function (err) { | ||
// extract zip | ||
extract(zipfile, {dir: tmp}, function (err) { | ||
if (err) return onerror(err) | ||
// move ipfs binary into place. | ||
fs.rename(path.join(tmp, "ipfs", "ipfs"), installPath, function(err) { | ||
if (err) return onerror(err) | ||
// remove zip from disk | ||
fs.unlink(zipfile, function(err) { | ||
if (err) return onerror(err) | ||
}) | ||
}) | ||
@@ -38,3 +50,3 @@ }) | ||
function onerror (err) { | ||
throw err | ||
if (err) throw err | ||
} | ||
@@ -41,0 +53,0 @@ |
{ | ||
"name": "go-ipfs", | ||
"version": "0.3.0", | ||
"version": "0.3.2", | ||
"description": "Install the latest go-ipfs binary", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -28,1 +28,5 @@ # install go-ipfs from npm | ||
## Development | ||
**Warning**: the file `bin/ipfs` is a placeholder, when downloading stuff, it gets replaced. so if you run `node install.js` it will then be dirty in the git repo. **Do not commit this file**, as then you would be commiting a big binary and publishing it to npm. (**TODO: add a pre-commit or pre-publish hook that warns about this**) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22170284
58
32
1