build.sh default configuration argument creates unexpected behavior
- Dominant language
- C#
- Stars
- 4.2k
- Forks
- 778
- Avg merge
- 1h 15m
- Merged PRs (30d)
- 19
Description
### What You Are Seeing?
On Mac I changed:
var configuration = Argument("configuration", "Release");
to
var configuration = Argument("configuration", "Debug");
Running the script ("./build.sh"), I see that argument value is Release when I provided a default of Debug:

### What is Expected?
I expect to see the new default value for the configuration argument be set to Debug per the change to the script.
When I run this on Windows the same way ".\build.ps1", I see the configuration argument value set to Debug.
### What version of Cake are you using?
0.27.0
### Are you running on a 32 or 64 bit system?
64
### What environment are you running on? Windows? Linux? Mac?
Mostly Mac but both Mac and Windows 10 in this case.
### Are you running on a CI Server? If so, which one?
No, local only.
### How Did You Get This To Happen? (Steps to Reproduce)
1. Default Cake example repo was cloned on my Mac
2. On Mac in VS Code in build.cake I changed
var configuration = Argument("configuration", "Release");
to
var configuration = Argument("configuration", "Debug");
and saved the script.
3. In VS Code's integrated terminal on Mac, I invoked the script with only "./build.sh"
4. Because I specified no configuration argument when invoking build.sh, I expected the Cake script to see no configuration argument value and to take the default value I provided of Debug (not overriding it with a default in build.sh). That expectation is reinforced with build.ps1 which does respect the fact that I didn't pass in a configuration argument so it uses my default of Debug.
I expect build.sh to do something similar to build.ps1:
if ($Configuration) { $cakeArguments += "-configuration=$Configuration" }
### Files
[build-files.zip](https://github.com/cake-build/cake/files/1951945/build-files.zip)
Contributor guide
Research direction
Start with build.sh and compare its configuration handling with build.ps1, then review the configuration argument in build.cake. Run ./build.sh without a configuration argument and confirm that the Cake script receives Debug after the script default is changed, matching the Windows behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, shell
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100