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

Functions

 main ()
 

Function Documentation

◆ main()

install_framework_headers.main ( )

Definition at line 14 of file install_framework_headers.py.

14def main():
15 parser = argparse.ArgumentParser(
16 description='Removes existing files and installs the specified headers' +
17 'at the given location.'
18 )
19
20 parser.add_argument(
21 '--headers', nargs='+', help='The headers to install at the location.', required=True
22 )
23 parser.add_argument('--location', type=str, required=True)
24
25 args = parser.parse_args()
26
27 # Remove old headers.
28 try:
29 shutil.rmtree(os.path.normpath(args.location))
30 except OSError as err:
31 # Ignore only "not found" errors.
32 if err.errno != errno.ENOENT:
33 raise err
34
35 # Create the directory to copy the files to.
36 if not os.path.isdir(args.location):
37 os.makedirs(args.location)
38
39 # Copy all files specified in the args.
40 for header_file in args.headers:
41 shutil.copyfile(header_file, os.path.join(args.location, os.path.basename(header_file)))
42
43
Definition main.py:1