Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions lib/definitions/project.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ interface IProjectData extends ICreateProjectData {
infoPlistPath: string;
buildXcconfigPath: string;
podfilePath: string;
initialized?: boolean;
/**
* Defines if the project is a code sharing one.
* Value is true when project has nativescript.config and it has `shared: true` in it.
Expand Down
5 changes: 5 additions & 0 deletions lib/project-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export class ProjectData implements IProjectData {
public isShared: boolean;
public previewAppSchema: string;
public webpackConfigPath: string;
public initialized: boolean;

constructor(
private $fs: IFileSystem,
Expand All @@ -116,6 +117,9 @@ export class ProjectData implements IProjectData {
}

public initializeProjectData(projectDir?: string): void {
if (this.initialized) {
return;
}
projectDir = projectDir || this.$projectHelper.projectDir;

// If no project found, projectDir should be null
Expand All @@ -126,6 +130,7 @@ export class ProjectData implements IProjectData {
const packageJsonContent = this.$fs.readText(projectFilePath);

this.initializeProjectDataFromContent(packageJsonContent, projectDir);
this.initialized = true;
}

return;
Expand Down
1 change: 0 additions & 1 deletion lib/services/project-data-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ export class ProjectDataService implements IProjectDataService {
this.projectDataCache[projectDir] ||
this.$injector.resolve<IProjectData>(ProjectData);
this.projectDataCache[projectDir].initializeProjectData(projectDir);

return this.projectDataCache[projectDir];
}

Expand Down