Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
write_revision_file Namespace Reference

Functions

 ParseArgs (args)
 
 Main (argv)
 

Function Documentation

◆ Main()

write_revision_file.Main (   argv)

Definition at line 27 of file write_revision_file.py.

27def Main(argv):
28 args = ParseArgs(argv)
29 if not args.no_git_hash:
30 revision = utils.GetGitRevision()
31 else:
32 revision = ''
33 if revision is not None:
34 with open(args.output, 'w') as f:
35 f.write('%s\n' % revision)
36 return 0
37
38
GetGitRevision(git_revision_file=None, repo_path=DART_DIR)
Definition utils.py:415

◆ ParseArgs()

write_revision_file.ParseArgs (   args)

Definition at line 12 of file write_revision_file.py.

12def ParseArgs(args):
13 args = args[1:]
14 parser = argparse.ArgumentParser(
15 description='A script to write the revision string to a file')
16
17 parser.add_argument(
18 '--output', '-o', type=str, required=True, help='File to write')
19 parser.add_argument('--no-git-hash',
20 help='Omit the git hash in the output',
21 dest='no_git_hash',
22 action='store_true')
23
24 return parser.parse_args(args)
25
26