mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
don't resolve symlinks as part of which (#5531)
* don't resolve symlinks as part of which * update method dartdoc
This commit is contained in:
parent
40f2b7bddb
commit
74446d78fc
@ -78,6 +78,8 @@ class AndroidSdk {
|
||||
|
||||
File aaptBin = os.which('aapt'); // in build-tools/$version/aapt
|
||||
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;
|
||||
if (validSdkDirectory(dir))
|
||||
return new AndroidSdk(dir);
|
||||
@ -85,6 +87,8 @@ class AndroidSdk {
|
||||
|
||||
File adbBin = os.which('adb'); // in platform-tools/adb
|
||||
if (adbBin != null) {
|
||||
// Make sure we're using the adb from the SDK.
|
||||
adbBin = new File(adbBin.resolveSymbolicLinksSync());
|
||||
String dir = adbBin.parent.parent.path;
|
||||
if (validSdkDirectory(dir))
|
||||
return new AndroidSdk(dir);
|
||||
|
||||
@ -54,15 +54,15 @@ class _PosixUtils extends OperatingSystemUtils {
|
||||
return Process.runSync('chmod', <String>['a+x', file.path]);
|
||||
}
|
||||
|
||||
/// Return the path (with symlinks resolved) to the given executable, or `null`
|
||||
/// if `which` was not able to locate the binary.
|
||||
/// Return the path to the given executable, or `null` if `which` was not able
|
||||
/// to locate the binary.
|
||||
@override
|
||||
File which(String execName) {
|
||||
ProcessResult result = Process.runSync('which', <String>[execName]);
|
||||
if (result.exitCode != 0)
|
||||
return null;
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user