-
Notifications
You must be signed in to change notification settings - Fork 0
/
commits.sh
61 lines (51 loc) · 1.71 KB
/
commits.sh
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
#!/bin/bash
func-commit(){
##Aqui.
caminhoDir="/home/pedro/workspace/Verdinho"
##Aqui.
meuUser="pedro"
meses=(Empty JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC)
for i in $(seq 1 12);
do
if [ "${meses[$i]}" = "JAN" ] || [ "${meses[$i]}" = "MAR" ] || [ "${meses[$i]}" = "MAY" ] || [ "${meses[$i]}" = "JUL" ] || [ "${meses[$i]}" = "AUG" ] || [ "${meses[$i]}" = "OCT" ] || [ "${meses[$i]}" = "DEC" ]
then
for j in $(seq 1 31)
do
sudo date -s "${meses[$i]} $j"
mkdir -p $caminhoDir/commits/evento-$j-$i
echo "https://github.com/Pedrobolfute/verdinho $j / $i / 2023" >> $caminhoDir/commits/evento-$j-$i/arquivo$j
cd $caminhoDir
git add .
git commit -m "$j ${meses[$i]}"
done
elif [ "${meses[$i]}" = "APR" ] || [ "${meses[$i]}" = "JUN" ] || [ "${meses[$i]}" = "SEP" ] || [ "${meses[$i]}" = "NOV" ]
then
for j in $(seq 1 30)
do
sudo date -s "${meses[$i]} $j"
mkdir -p $caminhoDir/commits/evento-$j-$i
echo "https://github.com/Pedrobolfute/verdinho $j / $i / 2023" >> $caminhoDir/commits/evento-$j-$i/arquivo$j
cd $caminhoDir
git add .
git commit -m "$j ${meses[$i]}"
done
elif [ "${meses[$i]}" = "FEB" ]
then
for j in $(seq 1 28)
do
sudo date -s "${meses[$i]} $j"
mkdir -p $caminhoDir/commits/evento-$j-$i
echo "https://github.com/Pedrobolfute/verdinho $j / $i / 2023" >> $caminhoDir/commits/evento-$j-$i/arquivo$j
cd $caminhoDir
git add .
git commit -m "$j ${meses[$i]}"
done
else
echo "Error dentro do IF!"
fi
done
##Aqui.
date -s "feb 19 15:47"
chown -R $meuUser:$meuUser $caminhoDir
}
func-commit >> logCommits.txt