On 17 November 2012 07:24, Mariano Martinez Peck marianopeck@gmail.com wrote:
Hi. The following script:
# run this script from build/ subdirectory, so vmVersionInfo.h will be placed in build dir
URL=`git config --get remote.origin.url` COMMIT=`git show HEAD --pretty="Commit: %H Date: %ci By: %cn <%cE>" | head -n 1`
echo -n "#define REVISION_STRING "$URL $COMMIT " > vmVersionInfo.h test -n "${BUILD_NUMBER}" && echo -n "Jenkins build #${BUILD_NUMBER}" >> vmVersionInfo.h || echo echo """ >> vmVersionInfo.h
fails in 10.6.8 because the result is:
-n #define REVISION_STRING "git://gitorious.org/cogvm/blessed.git Commit: e0c448cf8de6377605d8831ae20f72565c1922ca Date: 2012-11-14 15:34:11 +0100 By: Esteban Lorenzano estebanlm@gmail.com
"
(notice the -n at the beginning)
This -n is the one that is in the first echo: echo -n "#define REVISION_STRING "$URL $COMMIT " > vmVersionInfo.h
What is weird is that script works in Lion....
So, any workaround that could work in all OS?
what shell you using?
-- Mariano http://marianopeck.wordpress.com