commit | 545fe325baaf12a32711165ff27a80df9a71d391 | [log] [tgz] |
---|---|---|
author | Devon Carew <devoncarew@gmail.com> | Tue Feb 03 12:03:58 2015 -0800 |
committer | Devon Carew <devoncarew@gmail.com> | Tue Feb 03 12:03:58 2015 -0800 |
tree | f0df1ec56f99d734a20c7a07246a12f72eb80345 | |
parent | c96c42ddc0c0b0c671158f82d09e3557a1dd26d8 [diff] |
de-dup backticks
A utility 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.