-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
66 lines (49 loc) · 2.21 KB
/
main.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import os
import random
def create_and_commit(filename, message, days_ago=0):
# Check if Git is installed
if not os.path.exists(".git"):
print("Error: Not a Git repository")
return
# Create the directory 'green' if it doesn't exist
if not os.path.exists("green"):
os.makedirs("green")
# Create the file with some content inside 'green' directory
with open(os.path.join("green", filename), "w") as f:
f.write("This is a new file.\n")
# Stage the file for commit
os.system(f"git add green/{filename}") # Add with full path
# Commit the changes with the message
if days_ago == 0:
os.system(f"git commit -m \"{message}\"")
else:
os.system(
f"git commit -m \"{message}\" --date=\"{days_ago}days ago\"")
print(f"Created file 'green/{filename}' and committed with message: {message}")
banner = """
╔═╗┬┌┬┐┬ ┬┬ ┬┌┐
║ ╦│ │ ├─┤│ │├┴┐
╚═╝┴ ┴ ┴ ┴└─┘└─┘
╔═╗┌─┐┌┐┌┌┬┐┬─┐┬┌┐ ┬ ┬┌┬┐┬┌─┐┌┐┌
║ │ ││││ │ ├┬┘│├┴┐│ │ │ ││ ││││
╚═╝└─┘┘└┘ ┴ ┴└─┴└─┘└─┘ ┴ ┴└─┘┘└┘
┌─┐┬┬ ┬ ┌─┐┬─┐
├┤ ││ │ ├┤ ├┬┘
└ ┴┴─┘┴─┘└─┘┴└─
Developed By : Ahlyab
URL : https://github.com/Ahlyab/github-contribution-chart-filler
"""
print(banner)
# Example usage
days = int(input("Days to streak you want : "))
fn = input("Enter filename without extension : ")
for i in range(1, days + 1):
# Generate random number of commits between 1 and 10
num_commits = random.randint(1, 10)
for j in range(num_commits):
filename = f"{fn}_{i}_{j}.txt"
message = f"Added a new file on day {i} - commit {j+1}"
create_and_commit(filename, message, days - i + 1)
print(
"\n\n----------------------------------------\n[+] use the following command to push")
print("-> git push")