| # Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| # for details. All rights reserved. Use of this source code is governed by a |
| # BSD-style license that can be found in the LICENSE file. |
| parser = argparse.ArgumentParser( |
| description='A script to write the revision string to a file') |
| '--output', '-o', type=str, required=True, help='File to write') |
| parser.add_argument('--no-git-hash', |
| help='Omit the git hash in the output', |
| return parser.parse_args(args) |
| revision = utils.GetGitRevision() |
| with open(args.output, 'w') as f: |
| f.write('%s\n' % revision) |
| if __name__ == '__main__': |