This commit is contained in:
thosakwe 2017-06-03 22:19:44 -04:00
parent 40b155fb32
commit 0df2157300
6 changed files with 22 additions and 6 deletions

View file

@ -9,10 +9,12 @@
<excludeFolder url="file://$MODULE_DIR$/packages" />
<excludeFolder url="file://$MODULE_DIR$/sample_project/.pub" />
<excludeFolder url="file://$MODULE_DIR$/sample_project/bin/packages" />
<excludeFolder url="file://$MODULE_DIR$/sample_project/build" />
<excludeFolder url="file://$MODULE_DIR$/sample_project/packages" />
<excludeFolder url="file://$MODULE_DIR$/sample_project/test/packages" />
<excludeFolder url="file://$MODULE_DIR$/sample_project/test/services/packages" />
<excludeFolder url="file://$MODULE_DIR$/sample_project/tool/packages" />
<excludeFolder url="file://$MODULE_DIR$/sample_project/web/images/packages" />
<excludeFolder url="file://$MODULE_DIR$/sample_project/web/packages" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
@ -20,7 +22,7 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="application" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>

View file

@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="build.dart" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application" singleton="true" nameIsGenerated="true">
<option name="filePath" value="$PROJECT_DIR$/tool/build.dart" />
<option name="workingDirectory" value="$PROJECT_DIR$" />
<method />
</configuration>
</component>

View file

@ -142,10 +142,16 @@ class InitCommand extends Command {
}
}
_pubGet(Directory projectDir) async {
static String resolvePub() {
var exec = new File(Platform.resolvedExecutable);
var pubPath = exec.parent.uri.resolve('pub').path;
if (Platform.isWindows) pubPath = pubPath.replaceAll(_leadingSlashes, '');
if (Platform.isWindows) pubPath = pubPath.replaceAll(_leadingSlashes, '') + '.bat';
pubPath = Uri.decodeFull(pubPath);
return pubPath;
}
_pubGet(Directory projectDir) async {
var pubPath = resolvePub();
print('Running pub at "$pubPath"...');
var pub = await Process.start(pubPath, ["get"],
workingDirectory: projectDir.absolute.path);

View file

@ -3,6 +3,7 @@ import 'dart:io';
import 'package:args/command_runner.dart';
import 'package:watcher/watcher.dart';
import 'package:yaml/yaml.dart';
import 'init.dart';
Process server;
bool watching = false;
@ -76,7 +77,7 @@ class StartCommand extends Command {
if (scriptsNode != null && scriptsNode.containsKey('start')) {
try {
var scripts =
await Process.start('pub', ['global', 'run', 'scripts', 'start']);
await Process.start(InitCommand.resolvePub(), ['global', 'run', 'scripts', 'start']);
listen(scripts.stdout, stdout);
listen(scripts.stderr, stderr);
int code = await scripts.exitCode;

View file

@ -3,7 +3,7 @@ import 'dart:convert';
import 'package:http/src/base_client.dart' as http;
import 'package:pub_semver/pub_semver.dart';
final Version PACKAGE_VERSION = new Version(1, 0, 11);
final Version PACKAGE_VERSION = new Version(1, 0, 12);
Future<Version> fetchCurrentVersion(http.BaseClient client) async {
var response =
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."
homepage: "https://github.com/angel-dart/angel_cli"
name: "angel_cli"
version: 1.0.11
version: 1.0.12
dependencies:
# analyzer: "^0.29.0"
args: "^0.13.7"