UNPKG

2.05 kBJavaScriptView Raw
1"use strict";
2// Copyright (C) 2018 to the present, Crestron Electronics, Inc.
3// All rights reserved.
4// No part of this software may be reproduced in any form, machine
5// or natural, without the express written consent of Crestron Electronics.
6// Use of this source code is subject to the terms of the Crestron Software License Agreement
7// under which you licensed this source code.
8var __importDefault = (this && this.__importDefault) || function (mod) {
9 return (mod && mod.__esModule) ? mod : { "default": mod };
10};
11Object.defineProperty(exports, "__esModule", { value: true });
12const path_1 = __importDefault(require("path"));
13const enums_1 = require("./enums");
14const index_1 = require("./index");
15const config = {
16 "projectName": "showcase-app",
17 "directoryName": "../../library/showcase-app/dist",
18 "outputDirectory": "output-test",
19 "outputLevel": enums_1.OutputLevelEnum.Verbose,
20 "additionalAppuiManifestParameters": {
21 "testing-key": "testing-val",
22 "testing-key1": "testing-val1",
23 "testing-key2": "testing-val2",
24 "testing-key3": "testing-val3"
25 },
26 "additionalProjectManifestParameters": {
27 "testing-metadata": "testing-metadata",
28 "testing-metadata1": "testing-metadata2"
29 },
30 "controlSystemHost": "192.168.2.44",
31 "sftpUser": "crestron",
32 "sftpPassword": "",
33 "promptForCredential": false,
34 "sftpDirectory": "display",
35 "deviceType": enums_1.DeviceTypeEnum.TouchScreen,
36 "contractFile": undefined
37};
38let commands = process.argv;
39if (commands.includes('archive')) {
40 index_1.archiver(config)
41 .then(() => console.log('Archiving is done'));
42}
43else if (commands.includes('distribute')) {
44 index_1.distributor(path_1.default.resolve(config.outputDirectory, `${config.projectName}.ch5z`), config)
45 .then(() => {
46 console.log('Distribution is done');
47 process.exit(0);
48 })
49 .catch(err => {
50 console.error(err);
51 process.exit(1);
52 });
53}
54else {
55 throw new Error('Unknown command');
56}