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
28 try:
29 shutil.rmtree(os.path.normpath(args.location))
30 except OSError as err:
31
32 if err.errno != errno.ENOENT:
33 raise err
34
35
36 if not os.path.isdir(args.location):
37 os.makedirs(args.location)
38
39
40 for header_file in args.headers:
41 shutil.copyfile(header_file, os.path.join(args.location, os.path.basename(header_file)))
42
43