Add create command for plugin support

This commit is contained in:
Hidenori Matsubayashi
2021-07-16 15:56:25 +09:00
parent 74f833b779
commit eeb28eab23
8 changed files with 212 additions and 13 deletions
+13 -12
View File
@@ -115,16 +115,6 @@ class ELinuxCreateCommand extends CreateCommand {
try {
for (final Directory projectType
in eLinuxTemplates.listSync().whereType<Directory>()) {
final Directory sourceRunnerCommon =
projectType.childDirectory('runner');
if (!sourceRunnerCommon.existsSync()) {
continue;
}
final Directory sourceFlutter = projectType.childDirectory('flutter');
if (!sourceFlutter.existsSync()) {
continue;
}
final Directory dest = templates
.childDirectory(projectType.basename)
.childDirectory('elinux.tmpl');
@@ -133,8 +123,19 @@ class ELinuxCreateCommand extends CreateCommand {
}
copyDirectory(projectType, dest);
copyDirectory(sourceFlutter, dest.childDirectory('flutter'));
copyDirectory(sourceRunnerCommon, dest.childDirectory('runner'));
if (projectType.basename == 'app') {
final Directory sourceRunnerCommon =
projectType.childDirectory('runner');
if (!sourceRunnerCommon.existsSync()) {
continue;
}
final Directory sourceFlutter = projectType.childDirectory('flutter');
if (!sourceFlutter.existsSync()) {
continue;
}
copyDirectory(sourceFlutter, dest.childDirectory('flutter'));
copyDirectory(sourceRunnerCommon, dest.childDirectory('runner'));
}
created.add(dest);
}
return await runInternal();