Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dynamodb/config.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"setup": {
"download_url": "http://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz",
"download_url": "https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz",
"install_path": "bin",
"jar": "DynamoDBLocal.jar"
},
"start": {
"port": 8000
}
}
}
24 changes: 12 additions & 12 deletions dynamodb/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
var tar = require("tar"),
zlib = require("zlib"),
path = require("path"),
http = require("http"),
https = require("https"),
fs = require("fs"),
ProgressBar = require("progress"),
utils = require("./utils");

var download = function(downloadUrl, installPath, callback) {
var download = function (downloadUrl, installPath, callback) {
console.log(
`Started downloading dynamodb-local from ${downloadUrl} into ${installPath}. Process may take few minutes.`
);
http
.get(downloadUrl, function(response) {
https
.get(downloadUrl, function (response) {
var len = parseInt(response.headers["content-length"], 10),
bar = new ProgressBar(
"Downloading dynamodb-local [:bar] :percent :etas",
Expand All @@ -28,9 +28,9 @@ var download = function(downloadUrl, installPath, callback) {
if (200 != response.statusCode) {
throw new Error(
"Error getting DynamoDb local latest tar.gz location " +
response.headers.location +
": " +
response.statusCode
response.headers.location +
": " +
response.statusCode
);
}

Expand All @@ -41,22 +41,22 @@ var download = function(downloadUrl, installPath, callback) {
C: installPath
})
)
.on("data", function(chunk) {
.on("data", function (chunk) {
bar.tick(chunk.length);
})
.on("end", function() {
.on("end", function () {
callback("\n Installation complete!");
})
.on("error", function(err) {
.on("error", function (err) {
throw new Error("Error in downloading Dynamodb local " + err);
});
})
.on("error", function(err) {
.on("error", function (err) {
throw new Error("Error in downloading Dynamodb local " + err);
});
};

var install = function(config, callback) {
var install = function (config, callback) {
var install_path = utils.absPath(config.setup.install_path),
jar = config.setup.jar,
download_url = config.setup.download_url;
Expand Down
Loading