Skip to content

Commit 1eb9d79

Browse files
committed
handle symlinked dart executable
[email protected] Review URL: https://codereview.chromium.org//1133603005
1 parent 46708ff commit 1eb9d79

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/src/util/io.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ const _newline = 0xA;
2121
const _carriageReturn = 0xD;
2222

2323
/// The root directory of the Dart SDK.
24-
final String sdkDir =
25-
p.dirname(p.dirname(Platform.executable));
24+
final String sdkDir = (() {
25+
// TODO(kevmoo): work-around for accessing the SDK root dartbug.com/16994
26+
var path = new File(Platform.executable).resolveSymbolicLinksSync();
27+
return p.dirname(p.dirname(path));
28+
})();
2629

2730
/// The version of the Dart SDK currently in use.
2831
final Version _sdkVersion = new Version.parse(

0 commit comments

Comments
 (0)