This commit is contained in:
thosakwe 2017-04-26 09:21:25 -04:00
parent 8b71a2603d
commit 1675cbd701
8 changed files with 32 additions and 9 deletions

View file

@ -6,7 +6,6 @@
<excludeFolder url="file://$MODULE_DIR$/.tmp" /> <excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/bin/packages" /> <excludeFolder url="file://$MODULE_DIR$/bin/packages" />
<excludeFolder url="file://$MODULE_DIR$/build" /> <excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/example/packages" />
<excludeFolder url="file://$MODULE_DIR$/packages" /> <excludeFolder url="file://$MODULE_DIR$/packages" />
<excludeFolder url="file://$MODULE_DIR$/sample_project/.pub" /> <excludeFolder url="file://$MODULE_DIR$/sample_project/.pub" />
<excludeFolder url="file://$MODULE_DIR$/sample_project/bin/packages" /> <excludeFolder url="file://$MODULE_DIR$/sample_project/bin/packages" />
@ -17,6 +16,7 @@
<excludeFolder url="file://$MODULE_DIR$/sample_project/web/packages" /> <excludeFolder url="file://$MODULE_DIR$/sample_project/web/packages" />
<excludeFolder url="file://$MODULE_DIR$/temp" /> <excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" /> <excludeFolder url="file://$MODULE_DIR$/tmp" />
<excludeFolder url="file://$MODULE_DIR$/tool/packages" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />

View file

@ -6,6 +6,8 @@ import 'package:path/path.dart' as p;
import 'key.dart'; import 'key.dart';
import 'rename.dart'; import 'rename.dart';
final RegExp _leadingSlashes = new RegExp(r'^/+');
class InitCommand extends Command { class InitCommand extends Command {
final KeyCommand _key = new KeyCommand(); final KeyCommand _key = new KeyCommand();
final TextPen _pen = new TextPen(); final TextPen _pen = new TextPen();
@ -143,6 +145,7 @@ class InitCommand extends Command {
_pubGet(Directory projectDir) async { _pubGet(Directory projectDir) async {
var exec = new File(Platform.resolvedExecutable); var exec = new File(Platform.resolvedExecutable);
var pubPath = exec.parent.uri.resolve('pub').path; var pubPath = exec.parent.uri.resolve('pub').path;
if (Platform.isWindows) pubPath = pubPath.replaceAll(_leadingSlashes, '');
print('Running pub at "$pubPath"...'); print('Running pub at "$pubPath"...');
var pub = await Process.start(pubPath, ["get"], var pub = await Process.start(pubPath, ["get"],
workingDirectory: projectDir.absolute.path); workingDirectory: projectDir.absolute.path);

View file

@ -107,7 +107,7 @@ class ServiceCommand extends Command {
new ImportBuilder('package:angel_common/angel_common.dart')); new ImportBuilder('package:angel_common/angel_common.dart'));
generator.applyToLibrary(lib, name, lower); generator.applyToLibrary(lib, name, lower);
if (generator.createsModel == true) { if (generator.createsModel == true || typed) {
lib lib
..addMember(new ImportBuilder('../models/$lower.dart')) ..addMember(new ImportBuilder('../models/$lower.dart'))
..addMember(new ExportBuilder('../models/$lower.dart')); ..addMember(new ExportBuilder('../models/$lower.dart'));
@ -180,7 +180,7 @@ class $name extends Model {
if (!await file.exists()) await file.createSync(recursive: true); if (!await file.exists()) await file.createSync(recursive: true);
await file.writeAsString(''' await file.writeAsString('''
library ${pubspec.name}.models.$lower; library ${pubspec.name}.validtors.$lower;
import 'package:angel_validate/angel_validate.dart'; import 'package:angel_validate/angel_validate.dart';
final Validator $constantCase = new Validator({ final Validator $constantCase = new Validator({

View file

@ -2,11 +2,11 @@ import 'generator.dart';
import 'package:code_builder/code_builder.dart'; import 'package:code_builder/code_builder.dart';
class MapServiceGenerator extends ServiceGenerator { class MapServiceGenerator extends ServiceGenerator {
const MapServiceGenerator() : super('In-Memory');
@override @override
bool get createsModel => false; bool get createsModel => false;
const MapServiceGenerator() : super('In-Memory');
@override @override
ExpressionBuilder createInstance( ExpressionBuilder createInstance(
MethodBuilder methodBuilder, String name, String lower) { MethodBuilder methodBuilder, String name, String lower) {

View file

@ -5,6 +5,9 @@ import 'package:inflection/inflection.dart';
class MongoServiceGenerator extends ServiceGenerator { class MongoServiceGenerator extends ServiceGenerator {
const MongoServiceGenerator() : super('MongoDB'); const MongoServiceGenerator() : super('MongoDB');
@override
bool get createsModel => false;
@override @override
void applyToConfigureServer( void applyToConfigureServer(
MethodBuilder configureServer, String name, String lower) { MethodBuilder configureServer, String name, String lower) {

View file

@ -5,6 +5,9 @@ import 'package:inflection/inflection.dart';
class RethinkServiceGenerator extends ServiceGenerator { class RethinkServiceGenerator extends ServiceGenerator {
const RethinkServiceGenerator() : super('RethinkDB'); const RethinkServiceGenerator() : super('RethinkDB');
@override
bool get createsModel => false;
@override @override
void applyToConfigureServer( void applyToConfigureServer(
MethodBuilder configureServer, String name, String lower) { MethodBuilder configureServer, String name, String lower) {

View file

@ -34,9 +34,23 @@ class StartCommand extends Command {
@override @override
run() async { run() async {
if (argResults['watch']) { if (argResults['watch']) {
try {
new DirectoryWatcher('bin').events.listen((_) async => start()); new DirectoryWatcher('bin').events.listen((_) async => start());
} catch (e) {
// Fail silently...
}
try {
new DirectoryWatcher('config').events.listen((_) async => start()); new DirectoryWatcher('config').events.listen((_) async => start());
} catch (e) {
// Fail silently...
}
try {
new DirectoryWatcher('lib').events.listen((_) async => start()); new DirectoryWatcher('lib').events.listen((_) async => start());
} catch (e) {
// Fail silently...
}
} }
return await start(); return await start();

View file

@ -2,7 +2,7 @@ author: "Tobe O <thosakwe@gmail.com>"
description: "Command-line tools for the Angel framework." description: "Command-line tools for the Angel framework."
homepage: "https://github.com/angel-dart/angel_cli" homepage: "https://github.com/angel-dart/angel_cli"
name: "angel_cli" name: "angel_cli"
version: 1.0.10 version: 1.0.11
dependencies: dependencies:
# analyzer: "^0.29.0" # analyzer: "^0.29.0"
args: "^0.13.7" args: "^0.13.7"