Skip to content

Commit fe16df9

Browse files
committed
bulk-sync of content types added as experimental
1 parent 65b3760 commit fe16df9

File tree

5 files changed

+458
-9
lines changed

5 files changed

+458
-9
lines changed

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
.git/*
2-
.idea*/
3-
node_modules/
1+
node_modules
2+
package-lock.json

bin/index.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,35 @@ program
154154
});
155155
});
156156

157+
program
158+
.command('bulk-sync')
159+
.option('-e, --env <environment>', 'Enter the environment of which the content needs to be synchronized', undefined)
160+
.option('-t, --type [type]', 'Enter a type of content to include in publishing [content_types/assets/all]', /(content_types|assets|all)/, undefined)
161+
.option('-l, --lang [language]', 'Enter the language of which the content needs to be synchronized', undefined)
162+
.option('-c, --content_types [content_types]', 'Enter the content types to be included in synchronization (comma(\',\') seperated)', list, undefined)
163+
.option('-s, --skip_content_types [skip_content_types]', 'Enter the content types to be excluded from synchronization (comma(\',\') seperated)', list, undefined)
164+
.option('-d, --datetime [datetime]', 'Enter start date in ISO String format. Content published after this date will be synchronized (skip for all content)', undefined)
165+
.option('-b, --backup [backup]', 'Enter backup option', /(yes|no|y|n)/i, undefined)
166+
.description('Synchronize the previously published entries in the current application')
167+
.action(function(options) {
168+
setImmediate(function() {
169+
var context = domain.create();
170+
// error handling in domain
171+
context.on('error', errorHandler);
172+
// running the synchronization in domain
173+
context.run(function() {
174+
var _options = optionConversion(options);
175+
_options = helper.merge(getDefaultOptions(options, options._events), _options);
176+
try {
177+
var bulkSync = require('./../lib/bulk-sync');
178+
new bulkSync(_options);
179+
} catch (error) {
180+
console.error(error)
181+
}
182+
});
183+
});
184+
});
185+
157186
/*
158187
* command for bulk publish
159188
* */

0 commit comments

Comments
 (0)