Skip to content

Instantly share code, notes, and snippets.

@nikgraf
Created July 12, 2013 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikgraf/5988677 to your computer and use it in GitHub Desktop.
Save nikgraf/5988677 to your computer and use it in GitHub Desktop.
A small script to start Dartium with type checks and asserts enabled on OSX. To run it you need the Dart editor and added the `dart` command to $PATH
#!/usr/bin/env dart
import 'dart:io';
import 'dart:async';
main() {
// find and run Dartium with type checks and asserts enabled
var whichDart = Process.run('which', ['dart']);
whichDart.then((command) {
var dartiumExecutable = new Path(command.stdout).join(new Path('../../../chromium/Chromium.app/Contents/MacOS/Chromium'));
var dartiumCommand = dartiumExecutable.toString();
var environment = {'DART_FLAGS': '--enable-type-checks --enable-asserts'};
var dartium = Process.start(dartiumCommand, [], environment: environment);
})
.catchError((_) => print(_));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment