1 | /**
|
2 | * Copyright (c) 2018, Kinvey, Inc. All rights reserved.
|
3 | *
|
4 | * This software is licensed to you under the Kinvey terms of service located at
|
5 | * http://www.kinvey.com/terms-of-use. By downloading, accessing and/or using this
|
6 | * software, you hereby accept such terms of service (and any agreement referenced
|
7 | * therein) and agree that you have read, understand and agree to be bound by such
|
8 | * terms of service and are of legal age to agree to such terms with Kinvey.
|
9 | *
|
10 | * This software contains valuable confidential and proprietary information of
|
11 | * KINVEY, INC and is subject to applicable licensing agreements.
|
12 | * Unauthorized reproduction, transmission or distribution of this file and its
|
13 | * contents is a violation of applicable laws.
|
14 | */
|
15 |
|
16 | const yargs = require('yargs');
|
17 |
|
18 | const path = require('path');
|
19 | // advisable to happen before any other require
|
20 | process.env.NODE_CONFIG_DIR = path.join(__dirname, 'config');
|
21 |
|
22 | const updateNotifier = require('update-notifier');
|
23 |
|
24 | const config = require('config');
|
25 | const CLIManager = require('./lib/CLIManager');
|
26 | const logger = require('./lib/logger.js');
|
27 | const pkg = require('./package.json');
|
28 | const Setup = require('./lib/Setup');
|
29 |
|
30 | const setup = new Setup(config.paths.session);
|
31 | const notifier = updateNotifier({
|
32 | pkg,
|
33 | updateCheckInterval: 1000 * 60 * 60
|
34 | });
|
35 | const cliVersion = pkg.version;
|
36 | const Prompter = require('./lib/Prompter');
|
37 |
|
38 | const kinveyCLIManager = new CLIManager({ setup, config, logger, notifier, cliVersion, prompter: Prompter, commandsManager: yargs });
|
39 | kinveyCLIManager.init();
|