Skip to content

Commit d4a64a6

Browse files
committed
Change downloadDirectory to downloadFrom
1 parent 85f82d9 commit d4a64a6

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

dynamodb/core.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ let runningProcesses = {},
3232
return new BbPromise(function(resolve, reject) {
3333
/* Dynamodb local documentation http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html */
3434
let additionalArgs = [],
35-
downloadDirectory = options.downloadDirectory || DB_PATH;
35+
downloadFrom = options.downloadFrom || DB_PATH;
3636
options.port = options.port || 8000;
3737

3838
if (options.dbPath) {
@@ -55,14 +55,14 @@ let runningProcesses = {},
5555
if (options.help) {
5656
additionalArgs.push('-help');
5757
}
58-
installer.setup(downloadDirectory, DOWNLOAD_PATH, JAR, spinner)
58+
installer.setup(downloadFrom, DOWNLOAD_PATH, JAR, spinner)
5959
.then(function() {
6060
let args = [
61-
'-Djava.library.path=' + downloadDirectory + '/DynamoDBLocal_lib', '-jar', JAR, '-port', options.port
61+
'-Djava.library.path=' + downloadFrom + '/DynamoDBLocal_lib', '-jar', JAR, '-port', options.port
6262
];
6363
args = args.concat(additionalArgs);
6464
let child = spawn('java', args, {
65-
cwd: downloadDirectory,
65+
cwd: downloadFrom,
6666
env: process.env,
6767
stdio: ['pipe', 'pipe', process.stderr]
6868
});
@@ -83,7 +83,7 @@ let runningProcesses = {},
8383
console.log('Started: Dynamodb local(pid=' + child.pid + ') ', 'via java', args.join(' '));
8484
console.log('Visit: http://localhost:' + options.port + '/shell');
8585
writeFile(DB_PATH + '/options.json', options).then(resolve, reject);
86-
writeFile(DB_PATH + '/path.json', downloadDirectory);
86+
writeFile(DB_PATH + '/path.json', downloadFrom);
8787
});
8888
});
8989
},
@@ -98,9 +98,9 @@ let runningProcesses = {},
9898
this.start(port, db);
9999
},
100100
remove: function() {
101-
let downloadedDirectory = JSON.parse(fs.readFileSync(DB_PATH + '/path.json', 'utf8'));
102-
console.log("removing dynamodb from ", downloadedDirectory);
103-
installer.remove(downloadedDirectory);
101+
let downloadedFrom = JSON.parse(fs.readFileSync(DB_PATH + '/path.json', 'utf8'));
102+
console.log("removing dynamodb from ", downloadedFrom);
103+
installer.remove(downloadedFrom);
104104
}
105105
};
106106

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ module.exports = function(S) { // Always pass in the ServerlessPlugin Class
8383
shortcut: 'c',
8484
description: 'After starting dynamodb local, create dynamodb tables and run seeds'
8585
}, {
86-
option: 'downloadDirectory',
86+
option: 'downloadFrom',
8787
shortcut: 'D',
8888
description: 'Specify the path where you want to download dynamodb. Default path is serverless-dynamodb-local/dynamodb/bin'
8989
}]
@@ -132,7 +132,7 @@ module.exports = function(S) { // Always pass in the ServerlessPlugin Class
132132
options = _.merge({
133133
sharedDb: evt.options.sharedDb || true
134134
},
135-
evt.options,
135+
evt.options, { downloadFrom: config.downloadFrom },
136136
config && config.start
137137
),
138138
_spinner = SCli.spinner();

0 commit comments

Comments
 (0)