| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 #import('dart:io'); |
| 6 |
| 7 main() { |
| 8 List<String> arguments = new Options().arguments; |
| 9 print(arguments); |
| 10 String dartVmLocation = '${arguments[0]}/dart'; |
| 11 String dartdocLocation = '${arguments[0]}/dart'; |
| 12 String dartdocScript = """ |
| 13 #!$dartVmLocation |
| 14 |
| 15 main() { |
| 16 print(\"Hello, World! I'm $dartdocLocation\"); |
| 17 } |
| 18 """; |
| 19 var f = new File(dartdocLocation); |
| 20 var stream = f.openOutputStreamSync(); |
| 21 // TODO(ahe): Encode char codes as UTF-8. |
| 22 stream.write(dartdocScript.charCodes()); |
| 23 stream.close(); |
| 24 // TODO(ahe): Make script executable. |
| 25 // TODO(ahe): Also make a .bat file for Windows. |
| 26 } |
| OLD | NEW |