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
10 changes: 8 additions & 2 deletions lib/commands/stack/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ const handler = async argv => {
if (argv.postSync) {
body.post_sync = true;
}
} else if (argv.uploadsPath) {
body.uploads_path = argv.uploadsPath;
} else {
if (argv.uploadsPath) {
body.uploads_path = argv.uploadsPath;
}
if (argv.method) {
body.method = argv.method;
}
}

const data = await fetchJSON(v, `stack/applications/${target}/${route}?stream=true`, {
Expand All @@ -78,6 +83,7 @@ export default {
.option('from', { type: 'string', description: 'Source application id.' })
.option('tables', { type: 'string', description: 'Comma-separated database table names.' })
.option('uploads-path', { type: 'string', description: 'Uploads prefix to import.' })
.option('method', { type: 'string', choices: ['diff', 'legacy'], description: 'Import method for uploads: diff skips unchanged files, legacy copies everything.' })
.option('replace', { type: 'string', array: true, description: 'Search-replace mapping from=to.' })
.option('use-mydumper', { type: 'boolean', description: 'Use mydumper/myloader.' })
.option('post-sync', { type: 'boolean', description: 'Run post-sync after database import.' })
Expand Down
2 changes: 1 addition & 1 deletion lib/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function(url, opts) {

buf = '';

stream = got.default.stream(url, reqOpts);
stream = got.stream(url, reqOpts);

onclose = once(() => {
if (destroyed) return;
Expand Down