I'm packing an application using Cruise Control, the command is like this
<Exec Command="$(NugetToolPath) pack "@(NuSpecs)" -OutputDirectory \\servername\PackageSource -BasePath "%(NuSpecs.RootDir)%(NuSpecs.Directory)" -NoPackageAnalysis" />
Iv'e narrowed down the error to be the BasePath it comes out as
-BasePath "D:\Code\Mobile_Trunk\PreCompiledWeb\Portal\Mobile LT Admin\"
I know the issue because it should be
-BasePath "D:\Code\Mobile_Trunk\PreCompiledWeb\Portal\Mobile LT Admin"
but because I'm using .Directory metadata it will always return with a \ at the end
I normally wouldn't quote the base path, but since there are spaces in the directory, I have no choice. Is there a way around this? I don't know any other metadata which will return the full folder strucutre other than how I've layed it out
UPDATE:
I came to this solution, it's still not helped my knowledge on how to get around the issue with the illegal path, but it works.
<Exec Command="$(NugetToolPath) pack "%(NuSpecs.RootDir)%(NuSpecs.Directory)%(Nuspecs.FileName).nuspec" -OutputDirectory \\servername\PackageSource -NoPackageAnalysis" />
Just insert a space after the directory and before the quote character:
-OutputDirectory "\\servername\PackageSource\ "
See the accepted answer here (the question itself isn't highly relevant but the answer is):
How to accept command-line args ending in backslash
This fascinating reference is also linked to in another answer on that question:
http://www.daviddeley.com/autohotkey/parameters/parameters.htm#WINCRULESDOC
We got this error when we executed nuget restore
from Jenkins, where we ran a JNLP agent on the slave-node.
Turns out that "Path" in Illegal characters in path
means the PATH environment variable, and in our case nuget.exe was inheriting a PATH variable that had quotes in it, i.e. something like:
Path=C:\Program Files\foo;"C:\Program Files\bar"
If you are using Jenkins, add echo %PATH%
to be executed somewhere by Jenkins, and check if it has any funny characters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With