<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>RE: [Cook] commands in Cook actions</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>A couple of things may be causing the problem.<BR>
Using echo as you have done:<BR>
echo "#define VERSION $(git describe)" > src/version.h;<BR>
Is often tricky due to exactly where the variables are evaluated.<BR>
I suspect the ${git describe} is being evaluated as a shell variable as being empty thus you get an empty value.<BR>
<BR>
Better practice is to use the data dataend form or function write, using the cook variable for version. Examples<BR>
cat > [target]; data<BR>
#define VERSION [version]<BR>
dataend<BR>
<BR>
Or<BR>
function write [target] #define VERSION [version];<BR>
<BR>
I tend to favor the data dataend method because one can see exactly the resulting content and easily add to it if desired, Ala:<BR>
<BR>
cat > [target]; data<BR>
/* Automatically generated - do no edit */<BR>
#define VERSION [version]<BR>
dataend<BR>
<BR>
<BR>
<BR>
Jerry Pendergraft voice:651-756-3212<BR>
St.Jude Medical mobil:651-491-0163<BR>
Atrial Fibrillation Division email:jpendergraft@sjm.com<BR>
1350 Energy Lane<BR>
St.Paul, MN 55108<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: cook-users-bounces+jpendergraft=sjm.com@lists.auug.org.au on behalf of Andreas Wagner<BR>
Sent: Sat 15-May-10 13:34<BR>
To: cook-users@lists.auug.org.au<BR>
Subject: [Cook] commands in Cook actions<BR>
<BR>
Hello,<BR>
<BR>
I have this in my Howto.cook for automatically updating the version<BR>
number in my command line utility:<BR>
<BR>
src/version.h:<BR>
;<BR>
{<BR>
echo "#define VERSION $(git describe)" > src/version.h;<BR>
}<BR>
<BR>
after Cooking src/version.h contains:<BR>
define VERSION<BR>
<BR>
Shouldn't Cook execute this command as it would be executed on the command line?<BR>
<BR>
Thanks,<BR>
Andreas<BR>
_______________________________________________<BR>
Cook-users mailing list<BR>
Cook-users@lists.auug.org.au<BR>
<A HREF="http://lists.auug.org.au/listinfo/cook-users">http://lists.auug.org.au/listinfo/cook-users</A><BR>
<BR>
</FONT>
</P>
<DIV> </DIV>This communication, including any attachments, may contain information that is proprietary, privileged, confidential or legally exempt from disclosure. If you are not a named addressee, you are hereby notified that you are not authorized to read, print, retain a copy of or disseminate any portion of this communication without the consent of the sender and that doing so may be unlawful. If you have received this communication in error, please immediately notify the sender via return e-mail and delete it from your system.</BODY>
</HTML>