diff --git a/.idea/angel_cli.iml b/.idea/angel_cli.iml index 0a2188d..0f3fa76 100644 --- a/.idea/angel_cli.iml +++ b/.idea/angel_cli.iml @@ -9,10 +9,12 @@ + + @@ -20,7 +22,7 @@ - + \ No newline at end of file diff --git a/.idea/runConfigurations/build_dart.xml b/.idea/runConfigurations/build_dart.xml new file mode 100644 index 0000000..1bf4884 --- /dev/null +++ b/.idea/runConfigurations/build_dart.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/lib/src/commands/init.dart b/lib/src/commands/init.dart index 59f435b..7b01a35 100644 --- a/lib/src/commands/init.dart +++ b/lib/src/commands/init.dart @@ -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); diff --git a/lib/src/commands/start.dart b/lib/src/commands/start.dart index f9af79b..3d1580a 100644 --- a/lib/src/commands/start.dart +++ b/lib/src/commands/start.dart @@ -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; diff --git a/lib/src/pubspec.update.g.dart b/lib/src/pubspec.update.g.dart index 5e85f7e..04cc778 100644 --- a/lib/src/pubspec.update.g.dart +++ b/lib/src/pubspec.update.g.dart @@ -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 fetchCurrentVersion(http.BaseClient client) async { var response = await client.get('https://pub.dartlang.org/api/packages/angel_cli'); diff --git a/pubspec.yaml b/pubspec.yaml index bbb0ff9..a499da4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ author: "Tobe O " 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"