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

Side by Side Diff: packages/which/lib/which.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 unified diff | Download patch
« no previous file with comments | « packages/which/lib/src/which_impl.dart ('k') | packages/which/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 library which; 2 library which;
3 3
4 import 'dart:async'; 4 import 'dart:async';
5 import 'dart:io'; 5 import 'dart:io';
6 6
7 import 'src/candidate_paths.dart'; 7 import 'src/candidate_paths.dart';
8 import 'src/is_executable.dart'; 8 import 'src/is_executable.dart';
9 import 'src/which_impl.dart' as impl; 9 import 'src/which_impl.dart' as impl;
10 10
11 /// Returns a future for the first [command] executable in the `PATH`. 11 /// Returns a future for the first [command] executable in the `PATH`.
12 /// 12 ///
13 /// If [command] is not found, [orElse] is called, which defaults to throwing. 13 /// If [command] is not found, [orElse] is called, which defaults to throwing.
14 Future<String> which(String command, { orElse() }) => new Future(() => impl.whic h( 14 Future<String> which(String command, { orElse() }) => new Future(() => impl.whic h(
15 command, 15 command,
16 getRealCandidatePaths(command), 16 getRealCandidatePaths(command),
17 Platform.isWindows, 17 Platform.isWindows,
18 (path, isWindows) => isExecutable(path, isWindows, FileStat.stat), 18 (path, isWindows) => isExecutable(path, isWindows, FileStat.stat),
19 orElse)); 19 orElse));
20 20
21 /// Returns the first [command] executable in the `PATH`. 21 /// Returns the first [command] executable in the `PATH`.
22 /// 22 ///
23 /// If [command] is not found, [orElse] is called, which defaults to throwing. 23 /// If [command] is not found, [orElse] is called, which defaults to throwing.
24 String whichSync(String command, { orElse() }) => impl.whichSync( 24 String whichSync(String command, { orElse() }) => impl.whichSync(
25 command, 25 command,
26 getRealCandidatePaths(command), 26 getRealCandidatePaths(command),
27 Platform.isWindows, 27 Platform.isWindows,
28 (path, isWindows) => isExecutableSync(path, isWindows, FileStat.statSync), 28 (path, isWindows) => isExecutableSync(path, isWindows, FileStat.statSync),
29 orElse); 29 orElse);
OLDNEW
« no previous file with comments | « packages/which/lib/src/which_impl.dart ('k') | packages/which/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698