Skip to content

cdk init app: space causes failure #683

@scottiemc7

Description

@scottiemc7

What is the problem?

When running the cdk init app --language csharp command from a directory that has a space in its path, I get the following error:

~\Documents\My Projects\CdkTesting> cdk init app --language csharp

Applying project template app for csharp
Unrecognized command or argument 'Projects\CdkTesting\src\CdkTesting.sln'
Description:
  Add one or more projects to a solution file.

Usage:
  dotnet [options] sln <SLN_FILE> add [<PROJECT_PATH>...]

Arguments:
  <SLN_FILE>      The solution file to operate on. If not specified, the command will search the current directory for
                  one. [default: C:\Users\Scott\Documents\My Projects\CdkTesting\]
  <PROJECT_PATH>  The paths to the projects to add to the solution.

Options:
  --in-root                                Place project in root of the solution, rather than creating a solution
                                           folder.
  -s, --solution-folder <solution-folder>  The destination solution folder path to add the projects to.
  -?, -h, --help                           Show command line help.

Could not add project CdkTesting.csproj to solution CdkTesting.sln. Error code: 1

Reproduction Steps

Run 'cdk init app --language csharp' from a directory with a space in the path

What did you expect to happen?

A project to be created

What actually happened?

Loud noises and explosions

CDK CLI Version

2.10.0 (build e5b301f)

Framework Version

No response

Node.js Version

v12.22.7

OS

Windows

Language

.NET

Language Version

C#

Other information

Moving to a directory without a space in the path solved the issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions