UNPKG

1.16 kBJavaScriptView Raw
1#!/usr/bin/env node
2'use strict';
3
4var _commander = require('commander');
5
6var _commander2 = _interopRequireDefault(_commander);
7
8var _syncContent = require('./sync-content');
9
10var _build = require('./build');
11
12function _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/* global process */
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