UNPKG

1.59 kBJavaScriptView Raw
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
16const yargs = require('yargs');
17
18const path = require('path');
19// advisable to happen before any other require
20process.env.NODE_CONFIG_DIR = path.join(__dirname, 'config');
21
22const updateNotifier = require('update-notifier');
23
24const config = require('config');
25const CLIManager = require('./lib/CLIManager');
26const logger = require('./lib/logger.js');
27const pkg = require('./package.json');
28const Setup = require('./lib/Setup');
29
30const setup = new Setup(config.paths.session);
31const notifier = updateNotifier({
32 pkg,
33 updateCheckInterval: 1000 * 60 * 60
34});
35const cliVersion = pkg.version;
36const Prompter = require('./lib/Prompter');
37
38const kinveyCLIManager = new CLIManager({ setup, config, logger, notifier, cliVersion, prompter: Prompter, commandsManager: yargs });
39kinveyCLIManager.init();