Re: how to get project version in shell script phase?
Re: how to get project version in shell script phase?
- Subject: Re: how to get project version in shell script phase?
- From: Greg Guerin <email@hidden>
- Date: Wed, 28 Feb 2007 13:03:10 -0700
Marc Respass wrote:
>I want the disk image name to append the version of the project. Of course,
>I can just modify the script but that's such a drag. I'm hoping there's a
>way to get the value for CFBundleVersion in Info.plist but I can't find it.
If nothing else works, you can script the retrieval of CFBundleVersion
directly from the Info.plist of the built app-bundle you are about to
create a disk-image from. In some sense, this would be the most
authoritative version-number [1].
The 'defaults' command accepts a domain that can be a pathname without the
".plist" suffix. Since you have the pathname of your app-bundle, needed in
order to disk-image it, you can get the CFBundleVersion from its Info.plist
with:
defaults read "$PATH_TO_APP/Contents/Info" CFBundleVersion
See 'man defaults' for more information, especially the section on
Specifying Domains.
[1] WARNING: I'm not sure if 'defaults' will honor a "Version.plist" in
Contents/, so you may have to write some conditional shell script code.
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden