Skip to content

Instantly share code, notes, and snippets.

@liunian
Created June 23, 2018 02:42
Show Gist options
  • Save liunian/ec71ec2e92c0d887bd27e8e677257200 to your computer and use it in GitHub Desktop.
Save liunian/ec71ec2e92c0d887bd27e8e677257200 to your computer and use it in GitHub Desktop.
remove .svn directory
#!/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