OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. |
| 5 |
| 6 import argparse |
| 7 import os |
| 8 import sys |
| 9 import utils |
| 10 |
| 11 def ParseArgs(args): |
| 12 args = args[1:] |
| 13 parser = argparse.ArgumentParser( |
| 14 description='A script to write the version string to a file') |
| 15 |
| 16 parser.add_argument('--output', '-o', |
| 17 type=str, |
| 18 required=True, |
| 19 help='File to write') |
| 20 |
| 21 return parser.parse_args(args) |
| 22 |
| 23 |
| 24 def Main(argv): |
| 25 args = ParseArgs(argv) |
| 26 version = utils.GetVersion() |
| 27 with open(args.output, 'w') as versionFile: |
| 28 versionFile.write(version + '\n') |
| 29 return 0 |
| 30 |
| 31 if __name__ == '__main__': |
| 32 sys.exit(Main(sys.argv)) |
OLD | NEW |