-
Notifications
You must be signed in to change notification settings - Fork 0
/
push.sh
31 lines (24 loc) · 748 Bytes
/
push.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
#!/bin/bash
read -p 'Subject ID (0-9): ' subjectID
subjectList=("Mathematics" \
"Database-Systems" \
"Operating-Systems" \
"Digital-Logic" \
"Algorithms" \
"Computer-Networks" \
"Data-Structures-and-Algorithms" \
"Aptitude" \
"Artificial-Intelligence" \
"Cloud-Computing" \
"Computer-Architecture-and-Organisation")
subjectName=${subjectList[$((subjectID))]}
# Subject file name formatting
extension="md"
targetFile="${subjectName}.${extension}"
targetAssetsDir="${subjectName}"
# Commit message formatting
commitMessage="update: ${subjectName}"
# push to repository
git add README.md "./topics/${targetFile}" "./assets/images/${targetAssetsDir}"
git commit -m "${commitMessage}"
git push origin main