mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-25 08:12:40 +01:00
Resolve paths when running "--lintall"
Summary: this was all kinds of fail when running from a subdirectory or on invalid paths. Detect nonexistent paths; resolve valid paths. Test Plan: ran "arc lint --lintall" on a file from a subdirectory, and on a file which did not exist. Received patches and an error, respectively Reviewers: arudolph CC: Differential Revision: 72
This commit is contained in:
parent
eb58ed1b8b
commit
9b6e8aa6e1
1 changed files with 10 additions and 0 deletions
|
@ -139,6 +139,16 @@ EOTEXT
|
||||||
throw new ArcanistUsageException(
|
throw new ArcanistUsageException(
|
||||||
"You must specify one or more files to lint when using '--lintall'.");
|
"You must specify one or more files to lint when using '--lintall'.");
|
||||||
}
|
}
|
||||||
|
foreach ($paths as $key => $path) {
|
||||||
|
$full_path = Filesystem::resolvePath($path);
|
||||||
|
if (!Filesystem::pathExists($full_path)) {
|
||||||
|
throw new ArcanistUsageException("Path '{$path}' does not exist!");
|
||||||
|
}
|
||||||
|
$relative_path = Filesystem::readablePath(
|
||||||
|
$full_path,
|
||||||
|
$working_copy->getProjectRoot());
|
||||||
|
$paths[$key] = $relative_path;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$engine) {
|
if (!$engine) {
|
||||||
|
|
Loading…
Reference in a new issue