Skip to content

Commit

Permalink
feat: add publishable flag (#592)
Browse files Browse the repository at this point in the history
  • Loading branch information
erickzanardo authored and felangel committed Dec 6, 2022
1 parent da46724 commit 89e6930
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 85 deletions.
8 changes: 8 additions & 0 deletions lib/src/commands/create/create.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ class CreateCommand extends Command<int> {
'application-id',
help: 'The bundle identifier on iOS or application id on Android. '
'(defaults to <org-name>.<project-name>)',
)
..addFlag(
'publishable',
negatable: false,
help: 'Whether the generated project is intended to be published '
'(Does not affect flutter application templates)',
);
}

Expand Down Expand Up @@ -166,6 +172,7 @@ class CreateCommand extends Command<int> {
final executableName =
_argResults['executable-name'] as String? ?? projectName;
final applicationId = _argResults['application-id'] as String?;
final publishable = _argResults['publishable'] as bool?;
var vars = <String, dynamic>{
'project_name': projectName,
'description': description,
Expand All @@ -180,6 +187,7 @@ class CreateCommand extends Command<int> {
if (macos.toBool()) 'macos',
if (windows.toBool()) 'windows',
],
if (publishable != null) 'publishable': publishable,
};
await generator.hooks.preGen(vars: vars, onVarsChanged: (v) => vars = v);
final target = DirectoryGeneratorTarget(outputDirectory);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 89e6930

Please sign in to comment.