gn/rm.py
raw| 1 | #!/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 | |
| 8 | import os |
| 9 | import shutil |
| 10 | import sys |
| 11 | |
| 12 | dst, = sys.argv[1:] |
| 13 | |
| 14 | if os.path.exists(dst): |
| 15 | if os.path.isdir(dst): |
| 16 | shutil.rmtree(dst) |
| 17 | else: |
| 18 | os.remove(dst) |