commit | 3690f6e50e3b53e202a53c47b2fc3ed297ca6a53 | [log] [tgz] |
---|---|---|
author | Phil Quitslund <pq@users.noreply.github.com> | Fri May 22 14:59:08 2015 -0700 |
committer | Phil Quitslund <pq@users.noreply.github.com> | Fri May 22 14:59:08 2015 -0700 |
tree | 4e367c8113a54caf305969d15e99e0debef1fa7e | |
parent | 1bcc7a0a5a22f8e424c2908aadfee8208dbdc2c6 [diff] | |
parent | 1ad3a0719f2b469d5a4e2cb2383b1214ec13391f [diff] |
Merge pull request #9 from ochafik/getSdkDir_without_args Test that getSdkDir() finds the SDK without CLI args.
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 Directory sdkDir = getSdkDir(args); // Do stuff... For example, print version string File versionFile = new File(path.join(sdkDir.path, 'version')); print(versionFile.readAsStringSync()); }
Please file feature requests and bugs at the issue tracker.