Skip to content

Commit 42c98f4

Browse files
committed
Merge pull request #222 from NativeScript/totev/sync-common2
Fix TNS with latest changes from common lib
2 parents 22b0319 + e770ee3 commit 42c98f4

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

lib/nativescript-cli.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,23 @@
33
import path = require("path");
44
require("./bootstrap");
55

6+
import fiber = require("fibers");
7+
import Future = require("fibers/future");
68
import errors = require("./common/errors");
79
errors.installUncaughtExceptionListener();
810

9-
var dispatcher = $injector.resolve("dispatcher");
10-
dispatcher.runMainFiber();
11+
var config = <Config.IConfig>$injector.resolve("$config");
12+
(<IErrors>$injector.resolve("$errors")).printCallStack = config.DEBUG;
1113

14+
fiber(() => {
15+
var commandDispatcher : ICommandDispatcher = $injector.resolve("commandDispatcher");
16+
17+
if (process.argv[2] === "completion") {
18+
commandDispatcher.completeCommand().wait();
19+
} else {
20+
commandDispatcher.dispatchCommand().wait();
21+
}
22+
23+
$injector.dispose();
24+
Future.assertNoFutureLeftBehind();
25+
}).run();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"iconv-lite": "0.4.4",
3535
"ios-sim-portable": "1.0.2",
3636
"lockfile": "1.0.0",
37-
"lodash": "2.4.1",
37+
"lodash": "3.2.0",
3838
"log4js": "0.6.9",
3939
"mkdirp": "0.3.5",
4040
"mute-stream": "0.0.4",

test/platform-commands.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class PlatformData implements IPlatformData {
2727
}
2828

2929
class ErrorsNoFailStub implements IErrors {
30+
printCallStack: boolean = false;
31+
3032
fail(formatStr: string, ...args: any[]): void;
3133
fail(opts: { formatStr?: string; errorCode?: number; suppressCommandHelp?: boolean }, ...args: any[]): void;
3234

test/stubs.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
///<reference path=".d.ts"/>
2+
"use strict";
23

34
import Future = require("fibers/future");
45
import util = require("util");
@@ -156,6 +157,8 @@ export class ErrorsStub implements IErrors {
156157
}
157158

158159
verifyHeap(message: string): void { }
160+
161+
printCallStack: boolean = false;
159162
}
160163

161164
export class NPMStub implements INodePackageManager {

0 commit comments

Comments
 (0)