1 | #!/usr/bin/env node
|
2 | 'use strict';
|
3 |
|
4 | var _commander = require('commander');
|
5 |
|
6 | var _commander2 = _interopRequireDefault(_commander);
|
7 |
|
8 | var _syncContent = require('./sync-content');
|
9 |
|
10 | var _build = require('./build');
|
11 |
|
12 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13 |
|
14 | _commander2.default.command('sync').option('-s, --space <space>', 'Contentful space').option('-t, --token <space>', 'Contentful access token').action(function (options) {
|
15 | return (0, _syncContent.sync)(options.space, options.token).then(function (response) {
|
16 | process.stdout.write(JSON.stringify(response));
|
17 | });
|
18 | });
|
19 |
|
20 |
|
21 |
|
22 | _commander2.default.command('build').option('-c, --content <content>', 'content file').option('-v, --version <version>', 'version').option('-l, --locale <locale>', 'contentful locale').option('-t, --templates <templates>', 'template directory').option('-e, --environment [environment]', 'environment', 'production').action(function (options) {
|
23 | return (0, _build.buildSite)(options.content, options.templates, options.version, options.locale, options.environment);
|
24 | });
|
25 |
|
26 | _commander2.default.parse(process.argv); |
\ | No newline at end of file |