-
-
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
build.ps1: Imposible to pass an argument value with "," ";" symbols #73
Comments
The semicolon is a Powershell literal that you should be able to work around by escaping as such using the backtick ` character. Here is an example that works with Cake 0.21.1
|
@kcamp Thanks! It helps.
Only with single quotes (not double). |
@evil-shrike Yes, you're correct. I meant to call out the single/double difference because that threw me off, too when I was dealing with the issue. Glad you got it sorted out. 👍 |
I think the issue can be closed. But I'm afraid anyone who will try to pass such values (with "," or ";') will encounter difficulties. So ideally (in case it cannot be worked around in the bootstrap ps-script) it should be documented in some way... |
Is it possible to have conditional invocation instead of conditional expression creation with Invoke-Expression? The last one causes real issues in case you want to pass servicePrincipalKey having multiple special characters, when working with Azure CLI. In Write-Host "Running build script..."
if ($IsLinux -or $IsMacOS) {
&mono $CAKE_EXE $cakeArguments
} else {
&$CAKE_EXE $cakeArguments
} Sorry for my code, I'm not a PowerShell expert. |
@piotrzajac probably yes, I think what most do is to pass sectets as environment variables. Cake repos own bootstrapper does this, it doesn't use Mono though, but instead uses the Cake global tool, so diff between platforms there is executable name |
I have a cake script with Argument publishTargets:
I need to pass a value like "dev,internal" or "dev,release" and so on into it.
The key point here is "," symbol. With ";" symbol there's the same picture.
What I tried:
1. via
-arg
Output:
2. via ScriptArgs
Output:
3. via
--arg
Output:
4. Running directly via cake.exe
It works.
Environment
Cake 0.22.2
OS x64 Windows 10
The text was updated successfully, but these errors were encountered: