mirror of
https://github.com/status-im/re-natal.git
synced 2025-02-18 15:37:48 +00:00
getBundleId function
This commit is contained in:
parent
636c9484f9
commit
b3455b25e8
19
main.coffee
19
main.coffee
@ -68,6 +68,25 @@ readConfig = ->
|
|||||||
message
|
message
|
||||||
|
|
||||||
|
|
||||||
|
getBundleId = ({name}) ->
|
||||||
|
try
|
||||||
|
if line = readFile("iOS/iOS/#{name}.xcodeproj/project.pbxproj").match /PRODUCT_BUNDLE_IDENTIFIER = (.+);/
|
||||||
|
line[1]
|
||||||
|
else if line = readFile("iOS/iOS/#{name}/Info.plist").match /\<key\>CFBundleIdentifier\<\/key\>\n?\s*\<string\>(.+)\<\/string\>/
|
||||||
|
rfcIdRx = /\$\(PRODUCT_NAME\:rfc1034identifier\)/
|
||||||
|
|
||||||
|
if line[1].match rfcIdRx
|
||||||
|
line[1].replace rfcIdRx, name
|
||||||
|
else
|
||||||
|
line[1]
|
||||||
|
|
||||||
|
else
|
||||||
|
throw new Error 'Cannot find bundle identifier in project.pbxproj or Info.plist'
|
||||||
|
|
||||||
|
catch {message}
|
||||||
|
logErr message
|
||||||
|
|
||||||
|
|
||||||
init = (projName) ->
|
init = (projName) ->
|
||||||
projNameHyph = projName.replace(camelRx, '$1-$2').toLowerCase()
|
projNameHyph = projName.replace(camelRx, '$1-$2').toLowerCase()
|
||||||
projNameUs = projName.replace(camelRx, '$1_$2').toLowerCase()
|
projNameUs = projName.replace(camelRx, '$1_$2').toLowerCase()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user