2.1.0 done
This commit is contained in:
parent
5775c2ff1a
commit
ffef695da8
2 changed files with 26 additions and 28 deletions
|
@ -136,16 +136,16 @@ class InitCommand extends Command {
|
||||||
Process git;
|
Process git;
|
||||||
|
|
||||||
if (boilerplate.ref == null) {
|
if (boilerplate.ref == null) {
|
||||||
git = await Process.start("git", [
|
git = await Process.start(
|
||||||
"clone",
|
"git",
|
||||||
"--depth",
|
["clone", "--depth", "1", boilerplate.url, projectDir.absolute.path],
|
||||||
"1",
|
mode: ProcessStartMode.inheritStdio,
|
||||||
boilerplate.url,
|
);
|
||||||
projectDir.absolute.path
|
|
||||||
]);
|
|
||||||
} else {
|
} else {
|
||||||
// git clone --single-branch -b branch host:/dir.git
|
// git clone --single-branch -b branch host:/dir.git
|
||||||
git = await Process.start("git", [
|
git = await Process.start(
|
||||||
|
"git",
|
||||||
|
[
|
||||||
"clone",
|
"clone",
|
||||||
"--depth",
|
"--depth",
|
||||||
"1",
|
"1",
|
||||||
|
@ -154,12 +154,11 @@ class InitCommand extends Command {
|
||||||
boilerplate.ref,
|
boilerplate.ref,
|
||||||
boilerplate.url,
|
boilerplate.url,
|
||||||
projectDir.absolute.path
|
projectDir.absolute.path
|
||||||
]);
|
],
|
||||||
|
mode: ProcessStartMode.inheritStdio,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
stdout.addStream(git.stdout);
|
|
||||||
stderr.addStream(git.stderr);
|
|
||||||
|
|
||||||
if (await git.exitCode != 0) {
|
if (await git.exitCode != 0) {
|
||||||
throw new Exception("Could not clone repo.");
|
throw new Exception("Could not clone repo.");
|
||||||
}
|
}
|
||||||
|
@ -208,10 +207,8 @@ Future preBuild(Directory projectDir) async {
|
||||||
print('Running `pub run build_runner build`...');
|
print('Running `pub run build_runner build`...');
|
||||||
|
|
||||||
var build = await Process.start(resolvePub(), ['run', 'build'],
|
var build = await Process.start(resolvePub(), ['run', 'build'],
|
||||||
workingDirectory: projectDir.absolute.path);
|
workingDirectory: projectDir.absolute.path,
|
||||||
|
mode: ProcessStartMode.inheritStdio);
|
||||||
stdout.addStream(build.stdout);
|
|
||||||
stderr.addStream(build.stderr);
|
|
||||||
|
|
||||||
var buildCode = await build.exitCode;
|
var buildCode = await build.exitCode;
|
||||||
|
|
||||||
|
|
|
@ -59,8 +59,9 @@ class ModelCommand extends Command {
|
||||||
modelLib.directives
|
modelLib.directives
|
||||||
.add(new Directive.import('package:angel_model/angel_model.dart'));
|
.add(new Directive.import('package:angel_model/angel_model.dart'));
|
||||||
|
|
||||||
var needsSerialize =
|
var needsSerialize = argResults['serializable'] as bool ||
|
||||||
argResults['serializable'] as bool || argResults['orm'] as bool;
|
argResults['orm'] as bool ||
|
||||||
|
argResults['migration'] as bool;
|
||||||
|
|
||||||
if (needsSerialize) {
|
if (needsSerialize) {
|
||||||
modelLib.directives.add(new Directive.import(
|
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"'));
|
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([
|
modelLib.directives.addAll([
|
||||||
new Directive.import('package:angel_orm/angel_orm.dart'),
|
new Directive.import('package:angel_orm/angel_orm.dart'),
|
||||||
]);
|
]);
|
||||||
|
@ -92,7 +93,7 @@ class ModelCommand extends Command {
|
||||||
modelClazz.annotations.add(refer('serializable'));
|
modelClazz.annotations.add(refer('serializable'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argResults['orm'] as bool) {
|
if (argResults['orm'] as bool || argResults['migration'] as bool) {
|
||||||
if (argResults['migration'] as bool) {
|
if (argResults['migration'] as bool) {
|
||||||
modelClazz.annotations.add(refer('orm'));
|
modelClazz.annotations.add(refer('orm'));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue