Don't crash on flutter create . on Windows (#9850)
* Don't crash on `flutter create .` Fixes #9828 * review comments
This commit is contained in:
committed by
GitHub
parent
5a9b525146
commit
6337a0553c
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user