Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pub running, etc #66

Merged
merged 2 commits into from
May 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mono_repo/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* Support dependencies that specify an SDK – common with Flutter.
* Require at least Dart 2.0.0-dev.54.
* `pub` command now runs with inherited standard IO. You now see colors!

## 0.3.1

Expand Down
11 changes: 2 additions & 9 deletions mono_repo/lib/src/commands/pub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'dart:io';

import 'package:args/command_runner.dart';
import 'package:io/ansi.dart';
import 'package:io/io.dart';

import 'package:path/path.dart' as p;

Expand Down Expand Up @@ -54,17 +53,13 @@ Future<Null> pub(String pubCommand,
print(lightBlue
.wrap('Running `pub $pubCommand` across ${configs.length} package(s).'));

var processManager = new ProcessManager();

for (var dir in configs.keys) {
print('');
print(wrapWith('Starting `$dir`...', [styleBold, lightBlue]));
var workingDir = p.join(rootDirectory, dir);

// TODO(kevmoo): https://github.com/dart-lang/io/issues/22
Directory.current = workingDir;

var proc = await processManager.spawn('pub', [pubCommand]);
var proc = await Process.start('pub', [pubCommand],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: might as well fix this to do p.join(p.dirname(Platform.resolvedExecutable), 'pub')

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! Good idea!

mode: ProcessStartMode.inheritStdio, workingDirectory: workingDir);

var exit = await proc.exitCode;

Expand All @@ -74,6 +69,4 @@ Future<Null> pub(String pubCommand,
print(wrapWith('`$dir`: failed!', [styleBold, red]));
}
}

await ProcessManager.terminateStdIn();
}
2 changes: 1 addition & 1 deletion mono_repo/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:
sdk: '>=2.0.0-dev.54 <2.0.0'

dependencies:
args: ">=1.4.0 <2.0.0"
args: ^1.4.0
collection: ^1.14.3
graphs: ^0.1.0
io: ^0.3.2+1
Expand Down