Skip to content

Adding a path dependency with dart pub add uses \ in paths on Windows #4520

Description

@bkonyi

Ran into this while analyzing the generated widget preview scaffold project, which failed because the pubspec contained a path with Windows path separators.

To reproduce on Windows, run:

// Note the use of POSIX path separators
dart pub add 'my_package:{"path":"C:/src/my_package"}'

The resulting entry in pubspec.yaml uses Windows path separators:

my_package:
  path: C:\src\my_package

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions