Created
June 23, 2018 02:42
-
-
Save liunian/ec71ec2e92c0d887bd27e8e677257200 to your computer and use it in GitHub Desktop.
remove .svn directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import shutil | |
path = input('enter dir path: ') | |
del_list = [] | |
for p, d, f in os.walk(path): | |
if '.svn' in d: | |
del_path = os.path.join(os.path.abspath(p), '.svn/') | |
del_list.append(del_path) | |
print(del_path) | |
shutil.rmtree(del_path) | |
save_path = input('Where to save delete records: ') | |
with open(save_path, 'w') as f: | |
f.write(del_list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment