Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Unified Diff: which/lib/src/which_impl.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « which/lib/src/util.dart ('k') | which/lib/which.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: which/lib/src/which_impl.dart
diff --git a/which/lib/src/which_impl.dart b/which/lib/src/which_impl.dart
deleted file mode 100755
index 2f492954ad67182b17af2cdc493eb15ecf443193..0000000000000000000000000000000000000000
--- a/which/lib/src/which_impl.dart
+++ /dev/null
@@ -1,52 +0,0 @@
-
-library which.src.which_impl;
-
-import 'dart:async';
-
-import 'package:when/when.dart';
-
-import 'util.dart';
-
-Future<String> which(
- String command,
- Iterable<String> candidatePaths,
- bool isWindows,
- Future<bool> isExecutable(String path, bool isWindows),
- orElse()) => new Future(() => _which(
- command,
- candidatePaths,
- isWindows,
- isExecutable,
- orElse,
- toSequence: (items) => new Stream.fromIterable(items)));
-
-String whichSync(
- String command,
- Iterable<String> candidatePaths,
- bool isWindows,
- bool isExecutable(String path, bool isWindows),
- orElse()) => _which(
- command,
- candidatePaths,
- isWindows,
- isExecutable,
- orElse);
-
-_which(
- String command,
- Iterable<String> candidatePaths,
- bool isWindows,
- isExecutable(String path, bool isWindows),
- orElse(),
- {toSequence(Iterable items): identity}) => when(
- () => firstWhere(
- toSequence(candidatePaths),
- (path) => isExecutable(path, isWindows),
- orElse: orElse != null ? orElse : () => _commandNotFound(command, null)),
- onError: (e) => _commandNotFound(command, e));
-
-_commandNotFound(String command, e) {
- var message = 'Command not found: $command';
- if (e != null) message += '\n$e';
- throw new StateError(message);
-}
« no previous file with comments | « which/lib/src/util.dart ('k') | which/lib/which.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698