From ea1c91bd95fce4e8fc416d39382c5eb3024ec8b6 Mon Sep 17 00:00:00 2001 From: sis0k0 Date: Mon, 26 Mar 2018 21:10:06 +0300 Subject: [PATCH] fix-next(nsCliHelpers): return undefined if no global CLI --- nsCliHelpers.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nsCliHelpers.js b/nsCliHelpers.js index 66b2f8e6..8057bbf0 100644 --- a/nsCliHelpers.js +++ b/nsCliHelpers.js @@ -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); @@ -15,6 +19,10 @@ function getProjectData(projectDir) { function getNsCli() { const cliPath = getPath("nativescript", "tns"); + if (!cliPath) { + return; + } + const cli = require(cliPath); return cli;