@@ -62,7 +62,7 @@ export async function GetProjectDetails(credential: AppleCredential, xcodeVersio
6262 infoPlistPath = `${ projectDirectory } /Info.plist` ;
6363 }
6464 core . info ( `Info.plist path: ${ infoPlistPath } ` ) ;
65- const infoPlistHandle = await fs . promises . open ( infoPlistPath , 'r' ) ;
65+ const infoPlistHandle = await fs . promises . open ( infoPlistPath , fs . constants . O_RDWR ) ;
6666 let infoPlistContent : string ;
6767 try {
6868 infoPlistContent = await fs . promises . readFile ( infoPlistHandle , 'utf8' ) ;
@@ -104,7 +104,8 @@ export async function GetProjectDetails(credential: AppleCredential, xcodeVersio
104104 projectRef . bundleVersion = bundleVersion + 1 ;
105105 core . debug ( `Auto Incremented bundle version ==> ${ projectRef . bundleVersion } ` ) ;
106106 infoPlistJson [ 'CFBundleVersion' ] = projectRef . bundleVersion ;
107- const plistHandle = await fs . promises . open ( infoPlistPath , 'w' ) ;
107+ // read and write handle
108+ const plistHandle = await fs . promises . open ( infoPlistPath , fs . constants . O_RDWR ) ;
108109 try {
109110 await fs . promises . writeFile ( plistHandle , plist . build ( infoPlistJson ) ) ;
110111 core . info ( `Updated Info.plist with CFBundleVersion: ${ projectRef . bundleVersion } ` ) ;
@@ -254,7 +255,7 @@ export async function ArchiveXcodeProject(projectRef: XcodeProject): Promise<Xco
254255 }
255256 if ( projectRef . entitlementsPath ) {
256257 core . debug ( `Entitlements path: ${ projectRef . entitlementsPath } ` ) ;
257- const entitlementsHandle = await fs . promises . open ( projectRef . entitlementsPath , 'r' ) ;
258+ const entitlementsHandle = await fs . promises . open ( projectRef . entitlementsPath , fs . constants . O_RDONLY ) ;
258259 try {
259260 const entitlementsContent = await fs . promises . readFile ( entitlementsHandle , 'utf8' ) ;
260261 core . debug ( `----- Entitlements content: -----\n${ entitlementsContent } \n-----------------------------------` ) ;
@@ -441,7 +442,7 @@ async function getExportOptions(projectRef: XcodeProject): Promise<void> {
441442 if ( ! exportOptionsPath ) {
442443 throw new Error ( `Invalid path for export-option-plist: ${ exportOptionsPath } ` ) ;
443444 }
444- const exportOptionsHandle = await fs . promises . open ( exportOptionsPath , 'r' ) ;
445+ const exportOptionsHandle = await fs . promises . open ( exportOptionsPath , fs . constants . O_RDONLY ) ;
445446 try {
446447 const exportOptionContent = await fs . promises . readFile ( exportOptionsHandle , 'utf8' ) ;
447448 core . info ( `----- Export options content: -----\n${ exportOptionContent } \n-----------------------------------` ) ;
@@ -568,8 +569,8 @@ async function parseBundleLog(errorOutput: string) {
568569 log ( `Log file path is a directory: ${ logFilePath } ` , 'warning' ) ;
569570 return ;
570571 }
571- const logFileHandle = await fs . promises . open ( logFilePath , 'r' ) ;
572572 let logFileContent : string ;
573+ const logFileHandle = await fs . promises . open ( logFilePath , fs . constants . O_RDONLY ) ;
573574 try {
574575 logFileContent = await fs . promises . readFile ( logFileHandle , 'utf8' ) ;
575576 } finally {
0 commit comments