diff --git a/lib/src/commands/init.dart b/lib/src/commands/init.dart index cc8fcf16..9915891c 100644 --- a/lib/src/commands/init.dart +++ b/lib/src/commands/init.dart @@ -136,30 +136,29 @@ class InitCommand extends Command { Process git; if (boilerplate.ref == null) { - git = await Process.start("git", [ - "clone", - "--depth", - "1", - boilerplate.url, - projectDir.absolute.path - ]); + git = await Process.start( + "git", + ["clone", "--depth", "1", boilerplate.url, projectDir.absolute.path], + mode: ProcessStartMode.inheritStdio, + ); } else { // git clone --single-branch -b branch host:/dir.git - git = await Process.start("git", [ - "clone", - "--depth", - "1", - "--single-branch", - "-b", - boilerplate.ref, - boilerplate.url, - projectDir.absolute.path - ]); + git = await Process.start( + "git", + [ + "clone", + "--depth", + "1", + "--single-branch", + "-b", + boilerplate.ref, + boilerplate.url, + projectDir.absolute.path + ], + mode: ProcessStartMode.inheritStdio, + ); } - stdout.addStream(git.stdout); - stderr.addStream(git.stderr); - if (await git.exitCode != 0) { throw new Exception("Could not clone repo."); } @@ -208,10 +207,8 @@ Future preBuild(Directory projectDir) async { print('Running `pub run build_runner build`...'); var build = await Process.start(resolvePub(), ['run', 'build'], - workingDirectory: projectDir.absolute.path); - - stdout.addStream(build.stdout); - stderr.addStream(build.stderr); + workingDirectory: projectDir.absolute.path, + mode: ProcessStartMode.inheritStdio); var buildCode = await build.exitCode; diff --git a/lib/src/commands/make/model.dart b/lib/src/commands/make/model.dart index 0775025b..8f5cf4db 100644 --- a/lib/src/commands/make/model.dart +++ b/lib/src/commands/make/model.dart @@ -59,8 +59,9 @@ class ModelCommand extends Command { modelLib.directives .add(new Directive.import('package:angel_model/angel_model.dart')); - var needsSerialize = - argResults['serializable'] as bool || argResults['orm'] as bool; + var needsSerialize = argResults['serializable'] as bool || + argResults['orm'] as bool || + argResults['migration'] as bool; if (needsSerialize) { modelLib.directives.add(new Directive.import( @@ -70,7 +71,7 @@ class ModelCommand extends Command { deps.add(const MakerDependency('build_runner', '">=0.7.0 <0.10.0"')); } - if (argResults['orm'] as bool) { + if (argResults['orm'] as bool || argResults['migration'] as bool) { modelLib.directives.addAll([ new Directive.import('package:angel_orm/angel_orm.dart'), ]); @@ -92,7 +93,7 @@ class ModelCommand extends Command { modelClazz.annotations.add(refer('serializable')); } - if (argResults['orm'] as bool) { + if (argResults['orm'] as bool || argResults['migration'] as bool) { if (argResults['migration'] as bool) { modelClazz.annotations.add(refer('orm')); } else {