 Chromium Code Reviews
 Chromium Code Reviews Issue 1596483004:
  [fusl] Build libcxx atop fusl  (Closed) 
  Base URL: git@github.com:domokit/mojo.git@master
    
  
    Issue 1596483004:
  [fusl] Build libcxx atop fusl  (Closed) 
  Base URL: git@github.com:domokit/mojo.git@master| Index: fusl/tools/copy_libcxx_headers.py | 
| diff --git a/fusl/tools/copy_libcxx_headers.py b/fusl/tools/copy_libcxx_headers.py | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..5cf9a43e5b62f94896285755539196874ea4989f | 
| --- /dev/null | 
| +++ b/fusl/tools/copy_libcxx_headers.py | 
| @@ -0,0 +1,34 @@ | 
| +# Copyright 2016 The Chromium Authors. All rights reserved. | 
| +# Use of this source code is governed by a BSD-style license that can be | 
| +# found in the LICENSE file. | 
| + | 
| +import os | 
| +import shutil | 
| +import sys | 
| + | 
| + | 
| +def copytree(source_dir, target_dir): | 
| + """Copy a tree. | 
| 
viettrungluu
2016/02/10 15:59:31
nit: 2-space indents!*#@#@$?! :(
 
kulakowski
2016/02/10 19:52:35
Done.
 | 
| + | 
| + This is needed because shutil.copytree requires that |target| not | 
| + exist yet. | 
| + | 
| + """ | 
| + | 
| + for file in os.listdir(source_dir): | 
| + source = os.path.join(source_dir, file) | 
| + target = os.path.join(target_dir, file) | 
| + if os.path.isfile(source): | 
| 
viettrungluu
2016/02/10 15:59:31
Things will get sad if "foo" was a file and is cha
 | 
| + shutil.copy(source, target) | 
| + else: | 
| + copytree(source, target) | 
| + | 
| + | 
| +def main(): | 
| + source_path = sys.argv[1] | 
| + target_path = sys.argv[2] | 
| + copytree(source_path, target_path) | 
| + | 
| + | 
| +if __name__ == '__main__': | 
| + main() |