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

fix-next(nsCliHelpers): return undefined if no global CLI #476

Merged
merged 1 commit into from
Mar 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions nsCliHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ const PROJECT_DATA_GETTERS = {

function getProjectData(projectDir) {
const cli = getNsCli();
if (!cli) {
return {};
}

const projectDataService = cli.projectDataService;
const projectData = safeGet(cli, "getProjectData", projectDir);

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

function getNsCli() {
const cliPath = getPath("nativescript", "tns");
if (!cliPath) {
return;
}

const cli = require(cliPath);

return cli;
Expand Down