-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Relative path inconsistency in configuration #1058
Comments
This is actually a bug. The configuration file Note that the same cannot be said about the executed commands, so if you were to pass a relative path to the command for the output dir, this one should be relative to the working dir. |
The fix should be simple: in the Configuration factory if the path is provided it should be made absolute |
For me, having relative paths relative to working dir (sources root) seems more logical.
|
If you have: <?php
// /path/to/project/php-scoper.inc.php
return [
'out-dir' => 'my-dir',
]; The expectation is If you execute $ php-scoper add-prefix --out-dir=my-dir Then the expectation (as for any CLI command that allows a relative directory – make, git, ls, cp, npm, composer etc.) is that the directory used is Either way it should be documented though. |
I have /path/to/project/scoper$ vendor/bin/php-scoper add-prefix --working-dir=../src --config=../scoper/scoper.inc.php // /path/to/project/scoper/scoper.inc.php
$excludedFiles = [
'../src/exclude_me.php',
];
return [
'output-dir' => '../build',
'exclude-files' => [
// 'src/an-excluded-file.php',
...$excludedFiles,
],
];
Would be more logical to define |
Bug report
While 'output-dir' is relative to working dir, until then paths in 'exclude-files' are realtive to config file location.
This behavior is not mentioned in documentation and is very confusing.
The text was updated successfully, but these errors were encountered: