This commit is contained in:
Tobe O 2017-10-20 02:29:23 -04:00
parent 2854b28ec2
commit 3f4728bb37
3 changed files with 25 additions and 24 deletions

View file

@ -69,6 +69,7 @@ class InstallCommand extends Command {
if (!await packageDir.exists()) if (!await packageDir.exists())
throw 'No add-on named "$packageName" is installed. You might need to run `angel install --update`.'; throw 'No add-on named "$packageName" is installed. You might need to run `angel install --update`.';
print('Installing $packageName...');
Map<String, dynamic> values = { Map<String, dynamic> values = {
'project_name': pubspec.name, 'project_name': pubspec.name,
@ -77,9 +78,30 @@ class InstallCommand extends Command {
List<Glob> globs = []; List<Glob> globs = [];
var projectPubspec = await PubSpec.load(packageDir);
var deps = projectPubspec.dependencies.keys
.map((k) {
var dep = projectPubspec.dependencies[k];
if (dep is HostedReference)
return new MakerDependency(
k, dep.versionConstraint.toString());
return null;
})
.where((d) => d != null)
.toList();
deps.addAll(projectPubspec.devDependencies.keys.map((k) {
var dep = projectPubspec.devDependencies[k];
if (dep is HostedReference)
return new MakerDependency(k, dep.versionConstraint.toString(),
dev: true);
return null;
}).where((d) => d != null));
await depend(deps);
var promptFile = var promptFile =
new File.fromUri(packageDir.uri.resolve('angel_cli.yaml')); new File.fromUri(packageDir.uri.resolve('angel_cli.yaml'));
var projectPubspec = await PubSpec.load(packageDir);
if (await promptFile.exists()) { if (await promptFile.exists()) {
var contents = await promptFile.readAsString(); var contents = await promptFile.readAsString();
@ -120,27 +142,6 @@ class InstallCommand extends Command {
} }
} }
} }
var deps = projectPubspec.dependencies.keys
.map((k) {
var dep = projectPubspec.dependencies[k];
if (dep is HostedReference)
return new MakerDependency(
k, dep.versionConstraint.toString());
return null;
})
.where((d) => d != null)
.toList();
deps.addAll(projectPubspec.devDependencies.keys.map((k) {
var dep = projectPubspec.devDependencies[k];
if (dep is HostedReference)
return new MakerDependency(k, dep.versionConstraint.toString(),
dev: true);
return null;
}).where((d) => d != null));
await depend(deps);
} }
Future merge(Directory src, Directory dst, String prefix) async { Future merge(Directory src, Directory dst, String prefix) async {

View file

@ -3,7 +3,7 @@ import 'dart:convert';
import 'package:http/src/base_client.dart' as http; import 'package:http/src/base_client.dart' as http;
import 'package:pub_semver/pub_semver.dart'; import 'package:pub_semver/pub_semver.dart';
final Version PACKAGE_VERSION = new Version(1, 2, 0, build: '1'); final Version PACKAGE_VERSION = new Version(1, 2, 0, build: '3');
Future<Version> fetchCurrentVersion(http.BaseClient client) async { Future<Version> fetchCurrentVersion(http.BaseClient client) async {
var response = var response =
await client.get('https://pub.dartlang.org/api/packages/angel_cli'); await client.get('https://pub.dartlang.org/api/packages/angel_cli');

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.2.0+1 version: 1.2.0+3
dependencies: dependencies:
# analyzer: "^0.29.0" # analyzer: "^0.29.0"
args: ^0.13.4 args: ^0.13.4