This commit is contained in:
Tobe O 2019-01-09 12:46:12 -05:00
parent 0e56cc808c
commit eb82f173a6
5 changed files with 17 additions and 7 deletions

View file

@ -1,3 +1,7 @@
# 2.1.3
* Fix generation of ORM models.
* A `--project-name` to `init` command.
# 2.1.2
* No migrations-by-default.

View file

@ -22,7 +22,10 @@ class InitCommand extends Command {
"Initializes a new Angel project in the current directory.";
InitCommand() {
argParser..addFlag('pub-get', defaultsTo: true);
argParser
..addFlag('pub-get', defaultsTo: true)
..addOption('project-name',
abbr: 'n', help: 'The name for this project.');
}
@override
@ -44,8 +47,11 @@ class InitCommand extends Command {
new File.fromUri(projectDir.uri.resolve('config/production.yaml')),
secret);
var name = p.basenameWithoutExtension(
projectDir.absolute.uri.normalizePath().toFilePath());
var name = argResults.wasParsed('project-name')
? argResults['project-name'] as String
: p.basenameWithoutExtension(
projectDir.absolute.uri.normalizePath().toFilePath());
name = ReCase(name).snakeCase;
print('Renaming project from "angel" to "$name"...');
await renamePubspec(projectDir, 'angel', name);

View file

@ -98,8 +98,8 @@ class ModelCommand extends Command {
if (argResults['migration'] as bool) {
modelClazz.annotations.add(refer('orm'));
} else {
modelClazz.annotations.add(refer('Orm')
.newInstance([], {'generateMigration': literalFalse}));
modelClazz.annotations.add(
refer('Orm').call([], {'generateMigration': literalFalse}));
}
}
}));

View file

@ -29,7 +29,7 @@ class RenameCommand extends Command {
newName = prompts.get('Rename project to');
}
newName = new Recase(newName).snakeCase;
newName = new ReCase(newName).snakeCase;
var choice = prompts.getBool('Rename the project to `$newName`?');

View file

@ -2,7 +2,7 @@ author: Tobe O <thosakwe@gmail.com>
description: Command-line tools for the Angel framework.
homepage: https://github.com/angel-dart/angel_cli
name: angel_cli
version: 2.1.2
version: 2.1.3
dependencies:
analyzer: ">=0.32.0"
args: ^1.0.0