Debian Codegraph @

Externals/watcher/watcher/tool/portable-cp

raw symbols SCIP
1 #! /usr/bin/env python3
2
3 """
4 A portable `cp` command that works on both Windows and Unix-like systems.
5 """
6
7 import os
8 import sys
9 import shutil
10
11 def main():
12 if len(sys.argv) != 3:
13 print("Usage: {} SOURCE DEST".format(sys.argv[0]))
14 sys.exit(1)
15
16 src = sys.argv[1]
17 dst = sys.argv[2]
18
19 if os.path.isdir(src):
20 shutil.copytree(src, dst)
21 else:
22 shutil.copy2(src, dst)
23
24 if __name__ == "__main__":
25 main()