question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug? "More than one build script specified" when calling build.ps1 with a custom cake script and extra parameters

See original GitHub issue

What You Are Seeing?

When I specify a custom cake script with extra parameters using the build.ps1 bootstrap file, I get the following error:

More than one build script specified.

Note: If I remove the extra parameter that I would like to pass to my script everything works

What is Expected?

Cake executes using the custom cake script file

What version of Cake are you using?

0.13.0

Are you running on a 32 or 64 bit system?

64

What environment are you running on? Windows? Linux? Mac?

Windows

Are you running on a CI Server? If so, which one?

None

How Did You Get This To Happen? (Steps to Reproduce)

.\build.ps1 -Script “3rdPartyPackages.cake” -Settings=3rdPartyPackages.settings.json

Output Log

.\build.ps1 -Script "3rdPartyPackages.cake" -Settings="3rdPartyPackages.settings.json"
Preparing to run build script (3rdPartyPackages.cake)...
Running build script...
& "E:\Projects\tools\Cake\Cake.exe" "3rdPartyPackages.cake" -target="Default" -configuration="Release" -verbosity="Verbose"    -Settings=3rdPartyPackages.settin
gs\.json
More than one build script specified.

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

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:26 (9 by maintainers)

github_iconTop GitHub Comments

21reactions
kentcbcommented, Jun 26, 2018

Ugh, I just found #1690 which suggests the syntax I need is --target=Clean, which works fine. Seems like the main problem here is the confusing error message and the (lack of) docs.

12reactions
kcampcommented, Sep 23, 2016

I have seen this before, it seems to come from when the extra param value contains a ‘.’ > .\build.ps1 -Target "my-target" -Version="1.2.3"

this fails with the same output. from the notes i have on my fix, i looked at the cake source and see that the extra arguments will support ‘-’ or ‘–’ syntax.

i was able to change my use-case to the following to get it to work without modifying the build script or the underlying binary. > .\build.ps1 -Target "my-target" --Version="1.2.3"

this is with 0.15.2

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I pass my own custom arguments to build.ps1?
I assume you're using the default boostrapper. If so there's a -ScriptArgs parameter you can use to pass your custom Cake arguments.
Read more >
Bug? "More than one build script specified" when calling ...
When I specify a custom cake script with extra parameters using the build.ps1 bootstrap file, I get the following error:.
Read more >
Cake runner for .NET Framework
Custom switches. All switches not recognized by Cake will be added to an argument list that is passed to the build script. See...
Read more >
Simplifying the Cake global tool bootstrapper scripts with . ...
In this post I show how you can simplify your Cake global tool bootstrapper scripts by taking advantage of .NET Core 3.0 local...
Read more >
Back for seconds: Practical Cake build automation tasks
Below is an example of how to call a Cake build script from a command (.cmd) file, setting an environment variable value and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found