Support an executable in a symlinked directory.
Support an executable in a symlinked directory.

R=pquitslund@google.com

Review URL: https://chromiumcodereview.appspot.com//1132913003
3 files changed
tree: 53afd44441bab0f485f1b0f99a65a33d847edd27
  1. .gitignore
  2. .status
  3. .travis.yml
  4. AUTHORS
  5. CHANGELOG.md
  6. CONTRIBUTING.md
  7. LICENSE
  8. README.md
  9. codereview.settings
  10. lib/
  11. pubspec.yaml
  12. test/
  13. tool/
README.md

cli_util

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).

Build Status

Usage

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());
}

Features and bugs

Please file feature requests and bugs at the issue tracker.