Commit 6337a055 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

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

* Don't crash on `flutter create .`

Fixes #9828

* review comments
parent 5a9b5251
......@@ -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);
......
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