UNPKG

1.27 kBJavaScriptView Raw
1#!/usr/bin/env node
2
3/***************************************************************************************
4 * (c) 2017 Adobe. All rights reserved.
5 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License. You may obtain a copy
7 * of the License at http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software distributed under
10 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11 * OF ANY KIND, either express or implied. See the License for the specific language
12 * governing permissions and limitations under the License.
13 ****************************************************************************************/
14
15'use strict';
16
17var chalk = require('chalk');
18var validate = require('@adobe/reactor-validator');
19var extensionDescriptor = require('./helpers/extensionDescriptor');
20
21var error = validate(extensionDescriptor);
22
23if (error) {
24 console.error(chalk.red(error));
25 process.exit(1);
26}
27
28var task = process.argv.slice(2)[0];
29
30switch (task) {
31 case 'prepare':
32 require('./prepare')();
33 break;
34 case 'package':
35 default:
36 require('./package')();
37 break;
38}