Skip to content

Passing --exclude from the command line uses the project root for relative paths, rather than the current working directory #3384

Open
@Gedochao

Description

@Gedochao

Version(s)
1.5.4 and 4ab3227

Describe the bug
When passing a relative path to --exclude, the project root is used to calculate the resulting absolute path, rather than the current working directory.

To Reproduce

.
├── subdir
│   ├── project.scala
│   └── subsubdir
│       └── Whatever.scala
└── subdir2
    └── Something.scala

when running

scala-cli run subdir

the project root will be at ./subdir.
Let's say project.scala includes ./subdir2/Something.scala.

//> using file ../subdir2/Something.scala

Now, running scala-cli from .:

scala-cli run subdir --exclude subdir2/Something.scala

This won't actually exclude subdir2/Something.scala.
However, this will:

scala-cli run subdir --exclude ../subdir2/Something.scala

Expected behaviour
--exclude should use the current working directory for calculating relative paths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    --excludeIssues tied with the excluding inputs.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions