@@ -56,6 +56,7 @@ export class ProjectData implements IProjectData {
56
56
57
57
public initializeProjectData ( projectDir ?: string ) : void {
58
58
projectDir = projectDir || this . $projectHelper . projectDir ;
59
+
59
60
// If no project found, projectDir should be null
60
61
if ( projectDir ) {
61
62
const projectFilePath = path . join ( projectDir , this . $staticConfig . PROJECT_FILE_NAME ) ;
@@ -79,10 +80,7 @@ export class ProjectData implements IProjectData {
79
80
this . projectFilePath = projectFilePath ;
80
81
this . appDirectoryPath = path . join ( projectDir , constants . APP_FOLDER_NAME ) ;
81
82
this . appResourcesDirectoryPath = path . join ( projectDir , constants . APP_FOLDER_NAME , constants . APP_RESOURCES_FOLDER_NAME ) ;
82
- this . projectIdentifiers = {
83
- android : data . id . android || data . id ,
84
- ios : data . id . ios || data . id
85
- } ;
83
+ this . projectIdentifiers = this . getProjectIdentifiers ( data . id ) ;
86
84
this . dependencies = fileContent . dependencies ;
87
85
this . devDependencies = fileContent . devDependencies ;
88
86
this . projectType = this . getProjectType ( ) ;
@@ -99,6 +97,25 @@ export class ProjectData implements IProjectData {
99
97
this . $errors . fail ( "No project found at or above '%s' and neither was a --path specified." , projectDir || this . $options . path || currentDir ) ;
100
98
}
101
99
100
+ private getProjectIdentifiers ( data :any ) : IProjectIdentifier {
101
+ let identifier : IProjectIdentifier ;
102
+ data = data || "" ;
103
+
104
+ if ( typeof data === "string" ) {
105
+ identifier = {
106
+ android : data ,
107
+ ios : data
108
+ } ;
109
+ } else {
110
+ identifier = {
111
+ android : data . android || "" ,
112
+ ios : data . ios || ""
113
+ } ;
114
+ }
115
+
116
+ return identifier ;
117
+ }
118
+
102
119
private getProjectType ( ) : string {
103
120
let detectedProjectType = _ . find ( ProjectData . PROJECT_TYPES , ( projectType ) => projectType . isDefaultProjectType ) . type ;
104
121
0 commit comments