- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommitbot.py
More file actions
Latest commit
45 lines (36 loc) · 1.07 KB
/
Copy pathcommitbot.py
File metadata and controls
45 lines (36 loc) · 1.07 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
fromtimeimportsleep
importos
count=1
defupdate():
if'test1.txt'inos.listdir():
os.system('rename test1.txt test2.txt') #Renames file
elif'test2.txt'inos.listdir():
os.system('rename test2.txt test1.txt') #Renames file
else:
listdir=os.listdir()
forlistinlistdir:
iflist!='.git':
os.system('del '+list)
os.system('type nul > test1.txt')
defpull(repo,url):
ifos.path.exists(repo)==False:
os.system('git clone '+url)
dirname=os.path.dirname(__file__)
filename=os.path.join(dirname, ''+repo)
os.chdir(filename)
defpush():
globalcount
os.system('cd')
os.system('git add . && git commit -m "commit '+str(count) +'"')
os.system('git push origin main')
count+=1
defmain():
repo=input("Enter Git Repository name: ")
url=input("Enter Git Repository URL: ")
comm=int(input("Enter Number Of Commits To Perform: "))
pull(repo,url)
foriinrange(0,comm):
update()
push()
if__name__=='__main__':
main()