-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsend_to_git.py
29 lines (24 loc) · 879 Bytes
/
send_to_git.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import os
from os.path import join
import shutil
import subprocess
comand = "bash clean.sh"
process = subprocess.Popen(comand.split(), stdout=subprocess.PIPE)
process.communicate()
print("Done some cleanings")
unwanted_files = ['.DS_store', '.virtual_documents', '.ipynb_checkpoints', '__pycache__', 'catboost_info', 'lightning_logs']
print("List of tmp files:", unwanted_files)
command = input().strip()
if command.lower() == 'print': func = print
elif command.lower() == 'del': func = shutil.rmtree
for root, dirs, files in os.walk('./'):
for f in unwanted_files:
if f in dirs:
print(join(root, f))
func(join(root, f))
inp = input("Want to push ?")
if inp.lower() == "yes":
comand= "bash push_to_git.sh"
process = subprocess.Popen(comand.split(), stdout=subprocess.PIPE)
process.communicate()
else: print("Not pushing")