Skip to content

Commit

Permalink
Fix missing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorTaelin committed Jul 13, 2017
1 parent e58ad42 commit 3360c17
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/swarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var mimetype = require('mimetype');
var pick = require("./pick.js");
var request = require("xhr-request-promise");
var downloadUrl = "http://ethereum-mist.s3.amazonaws.com/swarm/";
var archives = require("./../archives/archives.json");

// ∀ a . String -> JSON -> Map String a -o Map String a
// Inserts a key/val pair in an object impurely.
Expand Down Expand Up @@ -337,7 +338,8 @@ var _download = function _download(swarmUrl) {
// resolves when the exact Swarm file is there, and verified to be correct.
// If it was already there to begin with, skips the download.
var downloadBinary = function downloadBinary(path) {
var system = require("o" + "s").platform().replace("win32", "windows") + "-" + (os.arch() === "x64" ? "amd64" : "386");
var os = require("o" + "s");
var system = os.platform().replace("win32", "windows") + "-" + (os.arch() === "x64" ? "amd64" : "386");
var archive = archives[system];
var archiveUrl = downloadUrl + archive.archive + ".tar.gz";
var archiveMD5 = archive.archiveMD5;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "swarm-js",
"version": "0.1.18",
"version": "0.1.19",
"description": "Swarm tools for JavaScript.",
"main": "lib/swarm.js",
"scripts": {
Expand Down
4 changes: 3 additions & 1 deletion src/swarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const mimetype = require('mimetype');
const pick = require("./pick.js");
const request = require("xhr-request-promise");
const downloadUrl = "http://ethereum-mist.s3.amazonaws.com/swarm/";
const archives = require("./../archives/archives.json");

// ∀ a . String -> JSON -> Map String a -o Map String a
// Inserts a key/val pair in an object impurely.
Expand Down Expand Up @@ -238,7 +239,8 @@ const download = swarmUrl => hash => path =>
// resolves when the exact Swarm file is there, and verified to be correct.
// If it was already there to begin with, skips the download.
const downloadBinary = path => {
const system = require("o"+"s").platform().replace("win32","windows") + "-" + (os.arch() === "x64" ? "amd64" : "386");
const os = require("o"+"s");
const system = os.platform().replace("win32","windows") + "-" + (os.arch() === "x64" ? "amd64" : "386");
const archive = archives[system];
const archiveUrl = downloadUrl + archive.archive + ".tar.gz";
const archiveMD5 = archive.archiveMD5;
Expand Down

0 comments on commit 3360c17

Please sign in to comment.