-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathcommitator.bat
64 lines (55 loc) · 1.14 KB
/
commitator.bat
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
ECHO off
SETLOCAL ENABLEDELAYEDEXPANSION
ECHO.
ECHO Enter your repository link
SET /P repo=""
ECHO.
ECHO Your link is: %repo%
ECHO.
ECHO Enter the name you wish the repo folder to be
SET /P folder=""
ECHO.
ECHO Enter the max number of commits you'd like in a day
SET /P max=""
ECHO.
ECHO Making repo...
mkdir %folder%
cd %folder%
ECHO.
ECHO Initialize git
git init
ECHO.
ECHO Generating fake contributions
FOR /L %%I IN (365,-1,0) DO ( :: Loop Backwards through year
mkdir %%I
cd %%I
call :genRand num :: Randomly determine number of commits that day
ECHO Seed: !num!
FOR /L %%J in (!num!, -1, 0) DO ( :: Loop through days commits
SET filename=%%I_%%J
SET /A rDate=%%I * 60*60*24
ECHO > !filename!.txt
git add !filename!.txt
git commit --date=format:relative:!rDate!.seconds.ago -m !filename!
)
cd..
ECHO.
)
git remote add origin !repo!
git push origin master
SET /P cleanUP="Cleanup? [y/n]"
IF %cleanUP%==y (
CD..
ECHO %cd%
IF exist %cd%/%folder% (
ECHO deleting repo
RMDIR /Q /S %cd%\%folder%
) ELSE (
ECHO No repo to delete
)
)
ENDLOCAL
PAUSE
:genRand
SET /A %1=%random% * (%max% - 1 + 1) / 32768 + 1
EXIT /B