Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Gedochao opened this issue Dec 20, 2024 · 0 comments
Labels
--exclude Issues tied with the excluding inputs. bug Something isn't working

Comments

@Gedochao
Copy link
Contributor

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.

@Gedochao Gedochao added bug Something isn't working --exclude Issues tied with the excluding inputs. labels Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--exclude Issues tied with the excluding inputs. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant