| # Copyright 2013 The Flutter Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| """Get the Git HEAD revision of a specified Git repository.""" |
| return os_id.startswith('win32') or os_id.startswith('cygwin') |
| def get_repository_version(repository): |
| 'Returns the Git HEAD for the supplied repository path as a string.' |
| if not os.path.exists(repository): |
| raise IOError('path does not exist') |
| version = subprocess.check_output([ |
| return str(version.strip(), 'utf-8') |
| parser = argparse.ArgumentParser() |
| help='Path to the Git repository.', |
| args = parser.parse_args() |
| repository = os.path.abspath(args.repository) |
| version = get_repository_version(repository) |
| if __name__ == '__main__': |