Skip to content

Fix starting the daemon client on Windows #110

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

Merged
merged 1 commit into from
Jan 31, 2019
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
10 changes: 7 additions & 3 deletions webdev/lib/src/serve/daemon_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ import 'package:webdev/src/util.dart';
Future<BuildDaemonClient> connectClient(
String workingDirectory, List<String> options) =>
BuildDaemonClient.connect(
workingDirectory,
[pubPath, 'run', 'build_runner', 'daemon']..addAll(options),
);
workingDirectory,
// On Windows we need to call the snapshot directly otherwise
// the process will start in a disjoint cmd without access to
// STDIO.
(Platform.isWindows ? [dartPath, pubSnapshot] : ['pub'])
..addAll(['run', 'build_runner', 'daemon'])
..addAll(options));

/// Returns the port of the daemon asset server.
int daemonPort(String workingDirectory) {
Expand Down
2 changes: 2 additions & 0 deletions webdev/lib/src/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ final String _sdkDir = (() {
})();

final String dartPath = p.join(_sdkDir, 'bin', 'dart');
final String pubSnapshot =
p.join(_sdkDir, 'bin', 'snapshots', 'pub.dart.snapshot');
final String pubPath =
p.join(_sdkDir, 'bin', Platform.isWindows ? 'pub.bat' : 'pub');
1 change: 0 additions & 1 deletion webdev/test/e2e_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ void main() {

group('should serve with valid configuration', () {
for (var command in ['serve', 'serve2']) {
if (command == 'serve2' && Platform.isWindows) return;
for (var withDDC in [true, false]) {
var type = withDDC ? 'DDC' : 'dart2js';
var name = 'using $command with $type';
Expand Down