2.1.0 done
This commit is contained in:
parent
5775c2ff1a
commit
ffef695da8
2 changed files with 26 additions and 28 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue