commit | d8f691a87b516145811695604d26a4a458d22171 | [log] [tgz] |
---|---|---|
author | Devon Carew <devoncarew@google.com> | Mon May 15 12:24:15 2017 -0700 |
committer | GitHub <noreply@github.com> | Mon May 15 12:24:15 2017 -0700 |
tree | b3f095a88bcb3abcaa3861bf02696a4bf1491163 | |
parent | 1161b131573209d4b04232965df740925934240b [diff] | |
parent | 7fae6203b3d8e2cd5bebd481e0cb1ff07d88f18e [diff] |
Merge pull request #13 from dart-lang/use_platform_resolvedExecutable introduce a getSdkPath() API
A library to help in building Dart command-line apps.
In particular, cli_util
provides a simple, standardized way to get the current SDK directory. Useful, especially, when building client applications that interact with the Dart SDK (such as the analyzer).
import 'dart:io'; import 'package:cli_util/cli_util.dart'; import 'package:path/path.dart' as path; main(args) { // Get sdk dir from cli_util. String sdkPath = getSdkPath(); // Do stuff... For example, print version string File versionFile = new File(path.join(sdkPath, 'version')); print(versionFile.readAsStringSync()); }
Please file feature requests and bugs at the issue tracker.