commit | 9e756916d733d9ee8f9880fb5defefc5f4e7a738 | [log] [tgz] |
---|---|---|
author | Phil Quitslund <pq@users.noreply.github.com> | Tue Feb 03 11:47:26 2015 -0800 |
committer | Phil Quitslund <pq@users.noreply.github.com> | Tue Feb 03 11:47:26 2015 -0800 |
tree | 6c9993fe2e98abf5ba4496900956e749769b01d2 | |
parent | b82b67df9add465b3e0f4d7335c3b601fe552e32 [diff] |
Update README.md
Utilities 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).
pub global activate cli_util
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.