0

I have been trying to use $ for buildArgs command

<buildArgs>git archive -o myfile.zip HEAD $(git diff --name-only remotes/origin/master)</buildArgs>

Cruise control is treating $ as a directive to resolve the symbol and giving error Internal Error: Reference to unknown symbol

Is there any way I can use $ as a symbol?

Kamran Shahid
  • 3,954
  • 5
  • 48
  • 93
hellowahab
  • 2,445
  • 4
  • 21
  • 34
  • see https://msdn.microsoft.com/en-us/library/ms228186.aspx and https://msdn.microsoft.com/en-us/library/bb383819.aspx – stijn Jun 06 '16 at 14:44
  • Thanks @stijn, I tried using %24 but it doesn't seems to work inside git command prompt – hellowahab Jun 07 '16 at 04:22
  • In that case you should post the error, and you probably should formulate your question differently: your problem isn't just how to pass $ to the commandline but rather how to get this commandline executed on windows, right? $ works in bash and other shells, not on the windows commandline, so you have to find the equivalent, or pass the entire thing through sh.exe (or powershell should also work). See http://stackoverflow.com/questions/24456200/git-archive-the-input-line-is-too-long-error-in-batch-file/24473368 – stijn Jun 07 '16 at 07:36

1 Answers1

0

Have you tried replacing $ with \$ so instead of

git archive -o myfile.zip HEAD $(git diff --name-only remotes/origin/master)

You could use

git archive -o myfile.zip HEAD \$(git diff --name-only remotes/origin/master)

This is the way to escape the $ character in bash, and although cruise control doesn't execute in the bash prompt, it will pass the arguments to git, see quoting and escaping in bash

Simon Laing
  • 1,194
  • 7
  • 18