I want to use to tf.exe command line utility and I want it 开发者_运维知识库to output the latest build revision number. (So output would be: '159' for example)
Is this possible?
Well TFS sux :> and I have the same problem. One solution that I came up with this:
tf properties . | grep "Server information" -A 3 | grep Changeset | gawk 'BEGIN {FS = ":"};{ sub(/^[ \t]+/, "",$2); print $2}'
to get the latest changeset number:
tf changeset /latest /noprompt | grep Changeset | gawk 'BEGIN {FS = ":"};{ sub(/^[ \t]+/, "",$2); print $2}'
grep and gawk are available at: http://unxutils.sourceforge.net/ this gets the version of the file/folder specified after properties.
精彩评论