Skip to content

Commit f042ba2

Browse files
authored
feat: allow local project installed {N} cli to be used (#273)
1 parent 14b898e commit f042ba2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { SUGGESTION_PROVIDERS } from './services/language-services/suggestions';
1414
// this method is called when the extension is activated
1515
export function activate(context: vscode.ExtensionContext) {
1616
services.globalState = context.globalState;
17-
services.cliPath = services.workspaceConfigService.tnsPath || services.cliPath;
17+
services.cliPath = 'tns';
1818

1919
const channel = vscode.window.createOutputChannel('NativeScript Extension');
2020

src/services/buildService.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ export class BuildService {
2121

2222
public async processRequest(args: any): Promise<any> {
2323
const tnsPath = services.workspaceConfigService.tnsPath;
24-
const cli = new NativeScriptCli(tnsPath, this._logger);
24+
25+
this._logger.log(`[NSDebugAdapter] Using tns CLI on path '${tnsPath}'\n`);
26+
const tnsPathResolved = (tnsPath !== 'tns' && !path.isAbsolute(tnsPath)) ? path.join(args.appRoot, tnsPath) : tnsPath;
27+
const cli = new NativeScriptCli(tnsPathResolved, this._logger);
2528

2629
const project = args.platform === 'ios' ?
2730
new IosProject(args.appRoot, cli) :

0 commit comments

Comments
 (0)