-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-ScriptArgs not working with "=" in other arguments #68
Comments
The problem here once again lies with build.ps1 like issue #74. |
Supposing that we only have to fix arguments in the format -name=value, we could add something like this to the bottom of build.ps1 (around line 243):
|
This would also cover #73 |
I have no doubt that cake would have worked fine. build.ps1 was supposed to serve as the single-source-of-truth for build definitions on that particular project, though. (And yeah, I'd probably try more or less exactly what you're proposing by way of fixing this.) |
Tried @Roadrunner67 solution with latest
After some tweaks, this is what I ended up with: If ($ScriptArgs) {
$Args = ($ScriptArgs) -split "\s+"
$ScriptArgs = ""
foreach ($element in $Args) {
$elementParts = ($element) -split "="
If ($elementParts.Length -eq 2) {
$ScriptArgs += $elementParts[0] + "=`"" + $elementParts[1].Trim("`"") + "`""
}
else {
$ScriptArgs += $element
}
}
}
# Build Cake arguments
$cakeArguments = ""
If ($Script) {
$cakeArguments += @("`"$Script`" ");
} |
I am using the following arguments in PowerShell with the bootstrapper:
.\build.ps1 -target=build -configuration=Debug -ScriptArgs='--packageVersion="1.0.0-dev"'
What You Are Seeing?
packageVersion
is staying set to the default value, "1.0.0".What is Expected?
packageVersion
= "1.0.0-dev"When I remove '=' from arguments, I get the expected results:
.\build.ps1 -target build -configuration Debug -ScriptArgs '--packageVersion="1.0.0-dev"'
What version of Cake are you using?
v0.32.1
Are you running on a 32 or 64 bit system?
64-bit
What environment are you running on? Windows? Linux? Mac?
Windows 10
Are you running on a CI Server? If so, which one?
TeamCity
How Did You Get This To Happen? (Steps to Reproduce)
Output Log
The text was updated successfully, but these errors were encountered: