Commit 74446d78 authored by Devon Carew's avatar Devon Carew Committed by GitHub

don't resolve symlinks as part of which (#5531)

* don't resolve symlinks as part of which

* update method dartdoc
parent 40f2b7bd
...@@ -78,6 +78,8 @@ class AndroidSdk { ...@@ -78,6 +78,8 @@ class AndroidSdk {
File aaptBin = os.which('aapt'); // in build-tools/$version/aapt File aaptBin = os.which('aapt'); // in build-tools/$version/aapt
if (aaptBin != null) { if (aaptBin != null) {
// Make sure we're using the aapt from the SDK.
aaptBin = new File(aaptBin.resolveSymbolicLinksSync());
String dir = aaptBin.parent.parent.parent.path; String dir = aaptBin.parent.parent.parent.path;
if (validSdkDirectory(dir)) if (validSdkDirectory(dir))
return new AndroidSdk(dir); return new AndroidSdk(dir);
...@@ -85,6 +87,8 @@ class AndroidSdk { ...@@ -85,6 +87,8 @@ class AndroidSdk {
File adbBin = os.which('adb'); // in platform-tools/adb File adbBin = os.which('adb'); // in platform-tools/adb
if (adbBin != null) { if (adbBin != null) {
// Make sure we're using the adb from the SDK.
adbBin = new File(adbBin.resolveSymbolicLinksSync());
String dir = adbBin.parent.parent.path; String dir = adbBin.parent.parent.path;
if (validSdkDirectory(dir)) if (validSdkDirectory(dir))
return new AndroidSdk(dir); return new AndroidSdk(dir);
......
...@@ -54,15 +54,15 @@ class _PosixUtils extends OperatingSystemUtils { ...@@ -54,15 +54,15 @@ class _PosixUtils extends OperatingSystemUtils {
return Process.runSync('chmod', <String>['a+x', file.path]); return Process.runSync('chmod', <String>['a+x', file.path]);
} }
/// Return the path (with symlinks resolved) to the given executable, or `null` /// Return the path to the given executable, or `null` if `which` was not able
/// if `which` was not able to locate the binary. /// to locate the binary.
@override @override
File which(String execName) { File which(String execName) {
ProcessResult result = Process.runSync('which', <String>[execName]); ProcessResult result = Process.runSync('which', <String>[execName]);
if (result.exitCode != 0) if (result.exitCode != 0)
return null; return null;
String path = result.stdout.trim().split('\n').first.trim(); String path = result.stdout.trim().split('\n').first.trim();
return new File(new File(path).resolveSymbolicLinksSync()); return new File(path);
} }
// unzip -o -q zipfile -d dest // unzip -o -q zipfile -d dest
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment