blob: 62c6e1769bae913dc2e80ac515eb0fce84a66195 [file] [log] [blame]
Mike Klein1a8d6752016-10-17 11:51:11 -04001#!/usr/bin/env python
2#
3# Copyright 2016 Google Inc.
4#
5# Use of this source code is governed by a BSD-style license that can be
6# found in the LICENSE file.
7
8import os
9import shutil
10import sys
11
12src, dst = sys.argv[1:]
13
14if os.path.exists(dst):
15 if os.path.isdir(dst):
16 shutil.rmtree(dst)
17 else:
18 os.remove(dst)
19
20if os.path.isdir(src):
21 shutil.copytree(src, dst)
22else:
23 shutil.copy2(src, dst)
Brian Salomonc993fe62020-09-28 14:45:57 -040024 #work around https://github.com/ninja-build/ninja/issues/1554
25 os.utime(dst, None)