This commit is contained in:
thosakwe 2016-11-23 19:42:29 -05:00
parent 52d96b4582
commit 2a212c9d40
2 changed files with 8 additions and 5 deletions

View file

@ -58,8 +58,6 @@ class ServiceCommand extends Command {
var servicesDir = new Directory("lib/src/services");
var serviceFile =
new File.fromUri(servicesDir.uri.resolve("${name.toLowerCase()}.dart"));
var serviceLibrary =
new File.fromUri(servicesDir.uri.resolve("services.dart"));
var testDir = new Directory("test/services");
var testFile = new File.fromUri(
testDir.uri.resolve("${name.toLowerCase()}_test.dart"));
@ -69,8 +67,13 @@ class ServiceCommand extends Command {
if (!await testDir.exists()) await testDir.create(recursive: true);
await serviceFile.writeAsString(serviceSource);
await serviceLibrary.writeAsString("\nexport '${name.toLowerCase()}.dart';",
if (type == MONGO_TYPED) {
var serviceLibrary = new File("lib/src/models/models.dart");
await serviceLibrary.writeAsString(
"\nexport '${name.toLowerCase()}.dart';",
mode: FileMode.APPEND);
}
await testFile.writeAsString(_generateTests(name, type));

View file

@ -1,5 +1,5 @@
name: angel_cli
version: 1.0.0-dev+3
version: 1.0.0-dev+4
description: Command-line tools for the Angel framework.
author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/angel_cli