Skip to content

build.ps1: Imposible to pass an argument value with "," ";" symbols #73

@evil-shrike

Description

@evil-shrike

I have a cake script with Argument publishTargets:

var publishTargets = Argument("publishTargets","dev,internal");

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

powershell ./build.ps1 -target Publish -publishTargets="internal,dev" -channel=SNAPSHOT --settings_skipverification=true

Output:

D:\Work\R-n-D\XFW3.git\Build>D:\Work\R-n-D\XFW3.git\Build\build-Publish.cmd
At line:1 char:53
+ ./build.ps1 -target Publish -publishTargets=internal,dev -channel=SNA ...
+                                                     ~
Missing argument in parameter list.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingArgument

2. via ScriptArgs

powershell ./build.ps1 -target Publish -ScriptArgs '-publishTargets="internal,dev" -channel=SNAPSHOT --settings_skipverification=true'

Output:

Running build script...
Invoke-Expression : At line:1 char:158
+ ... n="Release" -verbosity="Verbose"    -publishTargets=internal,dev -cha ...
+                                                                 ~
Missing argument in parameter list.
At D:\Work\R-n-D\XFW3.git\Build\build.ps1:188 char:1
+ Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -c ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ParserError: (:) [Invoke-Expression], ParseException
    + FullyQualifiedErrorId : MissingArgument,Microsoft.PowerShell.Commands.InvokeExpressionCommand

3. via --arg

powershell ./build.ps1 -target Publish --publishTargets="internal,dev" -channel=SNAPSHOT --settings_skipverification=true

Output:

D:\Work\R-n-D\XFW3.git\Build>D:\Work\R-n-D\XFW3.git\Build\build-Publish.cmd
Preparing to run build script...
Running build script...
More than one build script specified.

Usage: Cake.exe [script] [--verbosity=value]
                [--showdescription] [--dryrun] [..]

Example: Cake.exe

4. Running directly via cake.exe

It works.

tools/Cake/cake -target=Publish -publishTargets="internal;dev" -channel=SNAPSHOT -settings_skipverification=true -verbosity=diagnostic

Environment

Cake 0.22.2
OS x64 Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions