From 888839c7817e4b20026b111059a4d154bafa52c1 Mon Sep 17 00:00:00 2001 From: fatme Date: Mon, 1 Jul 2019 09:06:58 +0300 Subject: [PATCH] fix: fix prepare from plugin's directory Currently when prepare command is executed from plugin's directory, CLI throws an error that it is not able to find `webpack.config.js` file. This is due to the reason that CLI finds nativescript key in package.json and consider that directory as project dir. This PR fixes this behavior as checks if there is `id` inside nativescript key. --- lib/common/project-helper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common/project-helper.ts b/lib/common/project-helper.ts index 85be0b6be3..e0b34a1f7b 100644 --- a/lib/common/project-helper.ts +++ b/lib/common/project-helper.ts @@ -59,7 +59,7 @@ export class ProjectHelper implements IProjectHelper { if (this.$staticConfig.CLIENT_NAME_KEY_IN_PROJECT_FILE) { try { const fileContent = this.$fs.readJson(projectFilePath); - const clientSpecificData = fileContent[this.$staticConfig.CLIENT_NAME_KEY_IN_PROJECT_FILE]; + const clientSpecificData = fileContent[this.$staticConfig.CLIENT_NAME_KEY_IN_PROJECT_FILE] && fileContent[this.$staticConfig.CLIENT_NAME_KEY_IN_PROJECT_FILE].id; return !!clientSpecificData; } catch (err) { this.$errors.failWithoutHelp("The project file is corrupted. Additional technical information: %s", err);