Tim van der Lippe | 790b929 | 2019-09-19 15:14:16 +0000 | [diff] [blame^] | 1 | #!/usr/bin/env python |
| 2 | # -*- coding: UTF-8 -*- |
| 3 | # |
| 4 | # Copyright 2019 The Chromium Authors. All rights reserved. |
| 5 | # Use of this source code is governed by a BSD-style license that can be |
| 6 | # found in the LICENSE file. |
| 7 | """ |
| 8 | Copies the modules into the resources folder |
| 9 | """ |
| 10 | |
| 11 | from os.path import join, relpath |
| 12 | import shutil |
| 13 | import sys |
| 14 | |
| 15 | |
| 16 | def main(argv): |
| 17 | try: |
| 18 | input_path_flag_index = argv.index('--input_path') |
| 19 | input_path = argv[input_path_flag_index + 1] |
| 20 | output_path_flag_index = argv.index('--output_path') |
| 21 | output_path = argv[output_path_flag_index + 1] |
| 22 | devtools_modules = argv[1:input_path_flag_index] |
| 23 | except: |
| 24 | print 'Usage: %s module_1 module_2 ... module_N --input_path <input_path> --output_path <output_path>' % argv[0] |
| 25 | raise |
| 26 | |
| 27 | for file_name in devtools_modules: |
| 28 | shutil.copy(join(input_path, file_name), join(output_path, relpath(file_name, 'front_end'))) |
| 29 | |
| 30 | |
| 31 | if __name__ == '__main__': |
| 32 | sys.exit(main(sys.argv)) |