@@ -99,6 +99,17 @@ function listBundleFiles(bundleTypeDir, extensions) {
9999 . map ( ( entry ) => path . join ( bundleTypeDir , entry ) ) ;
100100}
101101
102+ function readMacOSAppBundleVersion ( appPath ) {
103+ const plistPath = path . join ( appPath , 'Contents' , 'Info.plist' ) ;
104+ try {
105+ const content = fs . readFileSync ( plistPath , 'utf8' ) ;
106+ const match = content . match ( / < k e y > C F B u n d l e S h o r t V e r s i o n S t r i n g < \/ k e y > \s * < s t r i n g > ( [ ^ < ] + ) < \/ s t r i n g > / ) ;
107+ return match ? match [ 1 ] . trim ( ) : null ;
108+ } catch {
109+ return null ;
110+ }
111+ }
112+
102113function verifyBundleVersion ( { targetDir, profile, expectedVersion, platform, bundles } ) {
103114 const normalizedPlatform = normalizePlatform ( platform ) ;
104115 const bundleTypes = resolveBundleTypes ( { bundles, platform : normalizedPlatform } ) ;
@@ -135,6 +146,22 @@ function verifyBundleVersion({ targetDir, profile, expectedVersion, platform, bu
135146 continue ;
136147 }
137148
149+ // macOS .app bundles don't include version in filename — check Info.plist
150+ if ( bundleType === 'app' ) {
151+ for ( const filePath of files ) {
152+ const plistVersion = readMacOSAppBundleVersion ( filePath ) ;
153+ if ( plistVersion && plistVersion === expectedVersion ) {
154+ continue ;
155+ }
156+ if ( ! plistVersion ) {
157+ errors . push ( `Could not read version from ${ path . basename ( filePath ) } /Contents/Info.plist` ) ;
158+ } else if ( plistVersion !== expectedVersion ) {
159+ errors . push ( `${ path . basename ( filePath ) } has version ${ plistVersion } , expected ${ expectedVersion } ` ) ;
160+ }
161+ }
162+ continue ;
163+ }
164+
138165 const matchedFiles = files . filter ( ( filePath ) => path . basename ( filePath ) . includes ( expectedVersion ) ) ;
139166 const staleFiles = files . filter ( ( filePath ) => ! path . basename ( filePath ) . includes ( expectedVersion ) ) ;
140167
0 commit comments