This repository was archived by the owner on Nov 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## 0.0.1+2
4
+
5
+ - Support an executable in a symlinked directory.
6
+
3
7
## 0.0.1+1
4
8
5
9
- Fix for when the dart executable can't be found by ` which ` .
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ library cli_util;
6
6
7
7
import 'dart:io' ;
8
8
9
+ import 'package:path/path.dart' as p;
9
10
import 'package:which/which.dart' ;
10
11
11
12
/// Return the path to the current Dart SDK. This will return `null` if we are
@@ -45,6 +46,12 @@ Directory getSdkDir([List<String> cliArgs]) {
45
46
executable = link.resolveSymbolicLinksSync ();
46
47
}
47
48
49
+ Link parentLink = new Link (p.dirname (executable));
50
+ if (parentLink.existsSync ()) {
51
+ executable = p.join (
52
+ parentLink.resolveSymbolicLinksSync (), p.basename (executable));
53
+ }
54
+
48
55
File dartVm = new File (executable);
49
56
Directory dir = dartVm.parent.parent;
50
57
if (_isSdkDir (dir)) return dir;
Original file line number Diff line number Diff line change 1
1
name : cli_util
2
- version : 0.0.1+1
2
+ version : 0.0.1+2
3
3
author :
Dart Team <[email protected] >
4
4
description : A library to help in building Dart command-line apps.
5
5
homepage : https://github.com/dart-lang/cli_util
6
6
environment :
7
7
sdk : ' >=1.0.0 <2.0.0'
8
8
dependencies :
9
+ path : ' >=1.0.0 <2.0.0'
9
10
which : ' >=0.1.2 <0.2.0'
10
11
dev_dependencies :
11
12
unittest : ' >=0.11.0 <0.12.0'
You can’t perform that action at this time.
0 commit comments