Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.0.1+3

- Find SDK properly when invoked from inside SDK tests.

## 0.0.1+2

- Support an executable in a symlinked directory.
Expand Down
9 changes: 8 additions & 1 deletion lib/cli_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ Directory getSdkDir([List<String> cliArgs]) {
}

// Look relative to the dart executable.
Directory sdkDirectory = new File(Platform.executable).parent.parent;
File platformExecutable = new File(Platform.executable);
Directory sdkDirectory = platformExecutable.parent.parent;
if (_isSdkDir(sdkDirectory)) return sdkDirectory;

// Handle the case where Platform.executable is a sibling of the SDK directory
// (this happens during internal testing).
sdkDirectory =
new Directory(p.join(platformExecutable.parent.path, 'dart-sdk'));
if (_isSdkDir(sdkDirectory)) return sdkDirectory;

// Try and locate the VM using 'which'.
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cli_util
version: 0.0.1+2
version: 0.0.1+3
author: Dart Team <misc@dartlang.org>
description: A library to help in building Dart command-line apps.
homepage: https://github.com/dart-lang/cli_util
Expand Down