Don't crash on flutter create . on Windows (#9850)

* Don't crash on `flutter create .`

Fixes #9828

* review comments
This commit is contained in:
Michael Goderbauer
2017-05-05 15:47:13 -07:00
committed by GitHub
parent 5a9b525146
commit 6337a0553c

View File

@@ -92,7 +92,10 @@ class CreateCommand extends FlutterCommand {
final bool generatePlugin = argResults['plugin'];
final Directory projectDir = fs.directory(argResults.rest.first);
final String dirPath = fs.path.normalize(projectDir.absolute.path);
String dirPath = fs.path.normalize(projectDir.absolute.path);
// TODO(goderbauer): Work-around for: https://github.com/dart-lang/path/issues/24
if (fs.path.basename(dirPath) == '.')
dirPath = fs.path.dirname(dirPath);
final String projectName = _normalizeProjectName(fs.path.basename(dirPath));
String error =_validateProjectDir(dirPath, flutterRoot: flutterRoot);