Unverified Commit a66ea4f2 authored by gaaclarke's avatar gaaclarke Committed by GitHub

Devicelab run.dart: Fixed check for path equality (#41403)

Fixed check for path equality.  It was too strict, disallowing leading "./".
parent efd2ba29
......@@ -123,7 +123,7 @@ final ArgParser _argParser = ArgParser()
if (fragments.length == 1 && !isDartFile) {
// Not a path
_taskNames.add(nameOrPath);
} else if (!isDartFile || fragments.length != 3 || !_listsEqual(<String>['bin', 'tasks'], fragments.take(2).toList())) {
} else if (!isDartFile || !path.equals(path.dirname(nameOrPath), path.join('bin', 'tasks'))) {
// Unsupported executable location
throw FormatException('Invalid value for option -t (--task): $nameOrPath');
} else {
......@@ -197,15 +197,3 @@ final ArgParser _argParser = ArgParser()
}
},
);
bool _listsEqual(List<dynamic> a, List<dynamic> b) {
if (a.length != b.length)
return false;
for (int i = 0; i < a.length; i++) {
if (a[i] != b[i])
return false;
}
return true;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment