Skip to content

Commit

Permalink
Merge branch 'master' of github.com:doapp-ryanp/dynamodb-local
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanp committed Aug 27, 2015
2 parents 9d9ad41 + 7d3d096 commit 1a3563b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var tmpDynamoLocalDirDest = path.join(os.tmpdir(), 'dynamodb-local'),
stdio: ['pipe', 'pipe', process.stderr]
});

if (!child.pid) throw new Error("Unable to launch DyanmoDBLocal process");
if (!child.pid) throw new Error("Unable to launch DynamoDBLocal process");

child
.on('error', function (err) {
Expand Down Expand Up @@ -107,21 +107,21 @@ function installDynamoDbLocal() {
} catch (e) {
}

console.log("DyanmoDb Local not installed. Installing...");
console.log("DynamoDb Local not installed. Installing...");

if (!fs.existsSync(tmpDynamoLocalDirDest))
fs.mkdirSync(tmpDynamoLocalDirDest);

http
.get('http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.tar.gz', function (response) {
if (302 != response.statusCode) {
deferred.reject(new Error("Error getting DyanmoDb local latest tar.gz location: " + response.statusCode));
deferred.reject(new Error("Error getting DynamoDb local latest tar.gz location: " + response.statusCode));
}

http
.get(response.headers['location'], function (redirectResponse) {
if (200 != redirectResponse.statusCode) {
deferred.reject(new Error("Error getting DyanmoDb local latest tar.gz location " + response.headers['location'] + ": " + redirectResponse.statusCode));
deferred.reject(new Error("Error getting DynamoDb local latest tar.gz location " + response.headers['location'] + ": " + redirectResponse.statusCode));
}
redirectResponse
.pipe(zlib.Unzip())
Expand All @@ -142,4 +142,4 @@ function installDynamoDbLocal() {
});

return deferred.promise;
}
}

0 comments on commit 1a3563b

Please sign in to comment.