Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 496fa55

Browse files
authored
fix-next(nsCliHelpers): return undefined if no global CLI (#476)
1 parent ce60606 commit 496fa55

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: nsCliHelpers.js

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ const PROJECT_DATA_GETTERS = {
77

88
function getProjectData(projectDir) {
99
const cli = getNsCli();
10+
if (!cli) {
11+
return {};
12+
}
13+
1014
const projectDataService = cli.projectDataService;
1115
const projectData = safeGet(cli, "getProjectData", projectDir);
1216

@@ -15,6 +19,10 @@ function getProjectData(projectDir) {
1519

1620
function getNsCli() {
1721
const cliPath = getPath("nativescript", "tns");
22+
if (!cliPath) {
23+
return;
24+
}
25+
1826
const cli = require(cliPath);
1927

2028
return cli;

0 commit comments

Comments
 (0)