-
-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathnativescript-cli.ts
33 lines (26 loc) · 1.09 KB
/
nativescript-cli.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
///<reference path=".d.ts"/>
"use strict";
// this call must be first to avoid requiring c++ dependencies
require("./common/verify-node-version").verifyNodeVersion(require("../package.json").engines.node);
require("./bootstrap");
import * as fiber from "fibers";
import Future = require("fibers/future");
import * as shelljs from "shelljs";
shelljs.config.silent = true;
import {installUncaughtExceptionListener} from "./common/errors";
installUncaughtExceptionListener(process.exit);
fiber(() => {
let config: Config.IConfig = $injector.resolve("$config");
let err: IErrors = $injector.resolve("$errors");
err.printCallStack = config.DEBUG;
let commandDispatcher: ICommandDispatcher = $injector.resolve("commandDispatcher");
let messages: IMessagesService = $injector.resolve("$messagesService");
messages.pathsToMessageJsonFiles = [/* Place client-specific json message file paths here */];
if (process.argv[2] === "completion") {
commandDispatcher.completeCommand().wait();
} else {
commandDispatcher.dispatchCommand().wait();
}
$injector.dispose();
Future.assertNoFutureLeftBehind();
}).run();