@@ -58047,10 +58047,10 @@ async function GetProjectDetails(credential, xcodeVersion) {
5804758047 finally {
5804858048 await infoPlistHandle.close();
5804958049 }
58050- const infoPlistJson = plist.parse(infoPlistContent);
58051- const cFBundleShortVersionString = infoPlistJson ['CFBundleShortVersionString'];
58050+ const infoPlist = plist.parse(infoPlistContent);
58051+ const cFBundleShortVersionString = infoPlist ['CFBundleShortVersionString'];
5805258052 core.info(`CFBundleShortVersionString: ${cFBundleShortVersionString}`);
58053- const cFBundleVersion = infoPlistJson ['CFBundleVersion'];
58053+ const cFBundleVersion = infoPlist ['CFBundleVersion'];
5805458054 core.info(`CFBundleVersion: ${cFBundleVersion}`);
5805558055 const projectRef = new XcodeProject_1.XcodeProject(projectPath, projectName, platform, bundleId, projectDirectory, cFBundleShortVersionString, cFBundleVersion, scheme, credential, xcodeVersion);
5805658056 await getExportOptions(projectRef);
@@ -58071,10 +58071,15 @@ async function GetProjectDetails(credential, xcodeVersion) {
5807158071 if (projectRef.bundleVersion <= bundleVersion) {
5807258072 projectRef.bundleVersion = bundleVersion + 1;
5807358073 core.debug(`Auto Incremented bundle version ==> ${projectRef.bundleVersion}`);
58074- infoPlistJson['CFBundleVersion'] = projectRef.bundleVersion;
58075- const plistHandle = await fs.promises.open(infoPlistPath, fs.constants.O_RDWR);
58074+ infoPlist['CFBundleVersion'] = projectRef.bundleVersion;
58075+ try {
58076+ await fs.promises.writeFile(infoPlistPath, plist.build(infoPlist));
58077+ }
58078+ catch (error) {
58079+ (0, utilities_1.log)(`Failed to update Info.plist!\n${error}`, 'error');
58080+ }
58081+ const plistHandle = await fs.promises.open(infoPlistPath, fs.constants.O_RDONLY);
5807658082 try {
58077- await fs.promises.writeFile(plistHandle, plist.build(infoPlistJson));
5807858083 core.info(`Updated Info.plist with CFBundleVersion: ${projectRef.bundleVersion}`);
5807958084 const updatedInfoPlistContent = await fs.promises.readFile(plistHandle, 'utf8');
5808058085 core.info(`----- Updated Info.plist content: -----\n${updatedInfoPlistContent}\n--------------------------------`);
0 commit comments