Skip to content

Commit 888839c

Browse files
committed
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.
1 parent 3cabd7e commit 888839c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/common/project-helper.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class ProjectHelper implements IProjectHelper {
5959
if (this.$staticConfig.CLIENT_NAME_KEY_IN_PROJECT_FILE) {
6060
try {
6161
const fileContent = this.$fs.readJson(projectFilePath);
62-
const clientSpecificData = fileContent[this.$staticConfig.CLIENT_NAME_KEY_IN_PROJECT_FILE];
62+
const clientSpecificData = fileContent[this.$staticConfig.CLIENT_NAME_KEY_IN_PROJECT_FILE] && fileContent[this.$staticConfig.CLIENT_NAME_KEY_IN_PROJECT_FILE].id;
6363
return !!clientSpecificData;
6464
} catch (err) {
6565
this.$errors.failWithoutHelp("The project file is corrupted. Additional technical information: %s", err);

0 commit comments

Comments
 (0)