cake-build / cake-build/cake

Working directory with a space

Open
#1,898 8 comments 0 reactions 0 assignees View on GitHub
Bug Help wanted Up-for-grabs
Dominant language
C#
Stars
4.2k
Forks
778
Avg merge
1h 15m
Merged PRs (30d)
19

Description

**What You Are Seeing?**
When trying to debug a cake script in vs code I am seeing the "More than one build script specified" error. I think it has something to do with my working directory having a space in a folder name as when I run without a build script specified I get an IO error and it seems to be combining my working path with the path **after** the space (see repro steps).

**What is Expected?**
I am expecting to be able to debug my cake script.

**What version of Cake are you using?**
0.23.0

**Are you running on a 32 or 64 bit system?**
64

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

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

Clone the example repo https://github.com/mholo65/cake-vscode-debug-example into a foder path with a space in the first folder i.e "c:\spaced folder\cakedebug\" and then hit F5 on vs code or, use PS:
1. cd "c:\spaced folder\cakedebug"
2. ./build.ps1
3. Observe error "More than one build script specified"

At this point you can take the space out of the base folder and rerun build.ps1, watch the build script run.

After this put the space back in the folder name and:

1. cd "c:\spaced folder\cakedebug"
2. dotnet tools/Cake.CoreCLR/Cake.dll --verbosity=diagnostic
3. Observe error:
Module directory does not exist.
Error: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\spaced folder\cakedebug\folder\cakedebug\tools\Cake.CoreCLR'.
at System.IO.Win32FileSystem.SetCurrentDirectory(String fullPath)
at System.IO.Directory.SetCurrentDirectory(String path)
at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath, IDictionary`2 arguments)
at Cake.Commands.BuildCommand.Execute(CakeOptions options)
at Cake.CakeApplication.Run(CakeOptions options)
at Cake.Program.Main()

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure from the linked cake-vscode-debug-example using build.ps1 and Cake.dll from a Windows path containing spaces. Start by tracing the reported path handling through Cake.Core.Scripting.ScriptRunner and Cake.Commands.BuildCommand; done means the example can run and debug successfully from the spaced directory without the duplicate build-script or DirectoryNotFoundException errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell, vscode
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.