import { execSync } from 'child_process' ; import { Logger } from './internal' ; export const minimumVersion = 9.4 ; export const appStoreId = '497799835' ; let _xcodeVersion = false ; export function getXcodeVersion ( ) { if ( _xcodeVersion !== false ) { return _xcodeVersion ; } try { const last = execSync ( 'xcodebuild -version' , { stdio : 'pipe' } ) . toString ( ) . match ( /^Xcode (\d+\.\d+)/ ) ?. [ 1 ] ; if ( last ) { _xcodeVersion = `${ last }.0` ; return _xcodeVersion ; } Logger . global . error ( 'Unable to check Xcode version. Command ran successfully but no version number was found.' ) ; } catch { } _xcodeVersion = null ; return _xcodeVersion ; } param appId export function openAppStore ( appId ) { const link = getAppStoreLink ( appId ) ; execSync ( `open ${ link }` , { stdio : 'ignore' } ) ; } function getAppStoreLink ( appId ) { if ( process . platform === 'darwin' ) { return `macappstore://itunes.apple.com/app/id${ appId }` ; } return `https://apps.apple.com/us/app/id${ appId }` ; }