Allow snippets tool to be run from arbitrary CWDs (#25243)
* Allow snippets tool to be run from arbitrary CWDs * Drop use of absolute when using Platform.executable (path is not relative, might require PATH resolution) * canonicalize paths * Use path.fromUri consistently to resolve file URIs * Force commit to try to kick Cirrus * Force commit to kick Cirrus, again
This commit is contained in:
@@ -30,8 +30,8 @@ class _ComponentTuple {
|
||||
class SnippetGenerator {
|
||||
SnippetGenerator({Configuration configuration})
|
||||
: configuration = configuration ??
|
||||
// This script must be run from dev/docs, so the root is up two levels.
|
||||
Configuration(flutterRoot: Directory(path.canonicalize(path.join('..', '..')))) {
|
||||
// Flutter's root is four directories up from this script.
|
||||
Configuration(flutterRoot: Directory(Platform.environment['FLUTTER_ROOT'] ?? path.canonicalize(path.join(path.dirname(path.fromUri(Platform.script)), '..', '..', '..')))) {
|
||||
this.configuration.createOutputDirectory();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user