Index: lib/src/global_packages.dart |
diff --git a/lib/src/global_packages.dart b/lib/src/global_packages.dart |
index 86ed14792d81b209ea5a77845a7f51b119ca6eda..06217a9f3b510f6ae731655bd1e4e736d13a15fc 100644 |
--- a/lib/src/global_packages.dart |
+++ b/lib/src/global_packages.dart |
@@ -770,7 +770,11 @@ pub global run ${package.name}:$script "\$@" |
'A web search for "configure windows path" will show you how.'); |
} else { |
// See if the shell can find one of the binstubs. |
- var result = runProcessSync("which", [installed]); |
+ // |
+ // The "command" builtin is more reliable than the "which" executable. See |
+ // http://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then |
+ var result = runProcessSync("command", ["-v", installed], |
+ runInShell: true); |
if (result.exitCode == 0) return; |
var binDir = _binStubDir; |