Skip to content

Commit

Permalink
Removing old tar.gz references
Browse files Browse the repository at this point in the history
  • Loading branch information
evertonfraga committed Aug 30, 2018
1 parent 56da3d3 commit 3e9be22
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 94 deletions.
5 changes: 1 addition & 4 deletions lib/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ var downloadAndCheck = function downloadAndCheck(url) {
// TODO: work for zip and other types
var extract = function extract(fromPath) {
return function (toPath) {
return tar.extract({
file: fromPath,
cwd: toPath
}).then(function () {
return tar.x(fromPath, toPath).then(function () {
return toPath;
});
};
Expand Down
163 changes: 82 additions & 81 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"xhr-request-promise": "^0.1.2"
},
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-preset-es2015": "^6.24.1",
"babel-cli": "^6.24.1"
"xml2js": "^0.4.19"
}
}
4 changes: 2 additions & 2 deletions scripts/prepareArchives.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const files = require("./../src/files.js");
const fs = require("fs-extra");
const got = require("got");
const path = require("path");
const targz = require("tar.gz");
const tar = require("tar");
const xml = require("xml2js");

// Downloads list of Geth releases
Expand Down Expand Up @@ -80,7 +80,7 @@ got("https://gethstore.blob.core.windows.net/builds?restype=container&comp=list"
.then(([swarmPath]) => fs.rename(swarmPath, bin.swarmBinaryPath))
.then(() => files.hash("md5")(bin.swarmBinaryPath))
.then(binaryMD5 => archive.binaryMD5 = binaryMD5)
.then(() => targz().compress(bin.swarmBinaryDir, bin.swarmArchivePath))
.then(() => tar.c({gzip: true, file: bin.swarmArchivePath}, bin.swarmBinaryDir))
.then(() => files.hash("md5")(bin.swarmArchivePath))
.then(archiveMD5 => archive.archiveMD5 = archiveMD5)
.catch(e => console.log(e));
Expand Down
8 changes: 2 additions & 6 deletions src/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ const fs = require("fs-extra");
const got = require("got");
const mkdirp = require("mkdirp-promise");
const path = require("path");

// TODO: this lib takes 0.5s to load! Must be replaced asap.
// Perhaps just use the unix `tar` command (cross platform?)
const targz = require("tar.gz");
const tar = require("tar");

// String -> String ~> Promise String
// Downloads a file from an url to a path.
Expand Down Expand Up @@ -68,8 +65,7 @@ const downloadAndCheck = url => path => fileHash =>
// String -> String ~> Promise String
// TODO: work for zip and other types
const extract = fromPath => toPath =>
targz()
.extract(fromPath, toPath)
tar.x(fromPath, toPath)
.then(() => toPath);

// String ~> Promise String
Expand Down

0 comments on commit 3e9be22

Please sign in to comment.