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

Unified Diff: packages/which/lib/src/candidate_paths.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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 | « packages/which/drone.sh ('k') | packages/which/lib/src/has_permission.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/which/lib/src/candidate_paths.dart
diff --git a/packages/which/lib/src/candidate_paths.dart b/packages/which/lib/src/candidate_paths.dart
deleted file mode 100755
index 3c987670772fe90c7e6de14559d638e1b713f740..0000000000000000000000000000000000000000
--- a/packages/which/lib/src/candidate_paths.dart
+++ /dev/null
@@ -1,36 +0,0 @@
-
-library which.src.candidate_paths;
-
-import 'dart:io';
-
-import 'package:path/path.dart';
-
-Iterable<String> getCandidatePaths(String command, Map<String, String> environment, bool isWindows, Context context) {
- if (context.isAbsolute(command)) return [command];
-
- String getEnvVar(String envVar, String defaultValue) {
- var v = environment[envVar];
- return v == null ? defaultValue : v;
- }
-
- var pathVarSeparator = isWindows ? ";" : ":";
-
- List<String> splitEnvVar(String envVar, String defaultValue) =>
- getEnvVar(envVar, defaultValue).split(pathVarSeparator);
-
- var pathEnv = splitEnvVar('PATH', '');
-
- var noExtPaths =
- pathEnv.map((pathEntry) => context.join(pathEntry, command));
-
- if (!isWindows) return noExtPaths;
-
- pathEnv.insert(0, context.current);
- var pathExt = splitEnvVar('PATHEXT', ".EXE");
- if (command.contains('.')) pathExt.insert(0, '');
- return noExtPaths.expand((commandPath) =>
- pathExt.map((pathExtEntry) => commandPath + pathExtEntry));
-}
-
-Iterable<String> getRealCandidatePaths(String command) =>
- getCandidatePaths(command, Platform.environment, Platform.isWindows, context);
« no previous file with comments | « packages/which/drone.sh ('k') | packages/which/lib/src/has_permission.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698