create intellij metadata from flutter create (#6429)
This commit is contained in:
@@ -168,8 +168,11 @@ Your main program file is lib/main.dart in the $relativePath directory.
|
||||
templateContext['withDriverTest'] = renderDriverTest;
|
||||
|
||||
Template createTemplate = new Template.fromName('create');
|
||||
fileCount += createTemplate.render(new Directory(dirPath), templateContext,
|
||||
overwriteExisting: false);
|
||||
fileCount += createTemplate.render(
|
||||
new Directory(dirPath),
|
||||
templateContext, overwriteExisting: false,
|
||||
projectName: projectName
|
||||
);
|
||||
|
||||
if (renderDriverTest) {
|
||||
Template driverTemplate = new Template.fromName('driver');
|
||||
|
||||
@@ -60,8 +60,12 @@ class Template {
|
||||
|
||||
Map<String /* relative */, String /* absolute source */> _templateFilePaths;
|
||||
|
||||
int render(Directory destination, Map<String, dynamic> context,
|
||||
{ bool overwriteExisting: true }) {
|
||||
int render(
|
||||
Directory destination,
|
||||
Map<String, dynamic> context, {
|
||||
bool overwriteExisting: true,
|
||||
String projectName
|
||||
}) {
|
||||
destination.createSync(recursive: true);
|
||||
int fileCount = 0;
|
||||
|
||||
@@ -72,6 +76,8 @@ class Template {
|
||||
.join(destinationDirPath, relativeDestPath)
|
||||
.replaceAll(_kCopyTemplateExtension, '')
|
||||
.replaceAll(_kTemplateExtension, '');
|
||||
if (projectName != null)
|
||||
finalDestinationPath = finalDestinationPath.replaceAll('projectName', projectName);
|
||||
File finalDestinationFile = new File(finalDestinationPath);
|
||||
String relativePathForLogging = path.relative(finalDestinationFile.path);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user