diff --git a/src/main.ts b/src/main.ts index 43c7135..47a4f41 100644 --- a/src/main.ts +++ b/src/main.ts @@ -11,7 +11,7 @@ import { services } from './services/extensionHostServices'; // this method is called when the extension is activated export function activate(context: vscode.ExtensionContext) { services.globalState = context.globalState; - services.cliPath = services.workspaceConfigService.tnsPath || services.cliPath; + services.cliPath = 'tns'; const channel = vscode.window.createOutputChannel('NativeScript Extension'); diff --git a/src/services/buildService.ts b/src/services/buildService.ts index 5fc2362..36905c6 100644 --- a/src/services/buildService.ts +++ b/src/services/buildService.ts @@ -21,7 +21,10 @@ export class BuildService { public async processRequest(args: any): Promise { const tnsPath = services.workspaceConfigService.tnsPath; - const cli = new NativeScriptCli(tnsPath, this._logger); + + this._logger.log(`[NSDebugAdapter] Using tns CLI on path '${tnsPath}'\n`); + const tnsPathResolved = (tnsPath !== 'tns' && !path.isAbsolute(tnsPath)) ? path.join(args.appRoot, tnsPath) : tnsPath; + const cli = new NativeScriptCli(tnsPathResolved, this._logger); const project = args.platform === 'ios' ? new IosProject(args.appRoot, cli) :