-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartCoding.sh
More file actions
70 lines (46 loc) · 1.4 KB
/
startCoding.sh
File metadata and controls
70 lines (46 loc) · 1.4 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
# A bash script for Automating system update and starting coding enviorment.
# for full system update
echo "==========================="
echo "Starting full system update"
echo "==========================="
sudo apt-get update
sudo apt-get upgrade
sudo apt autoclean
sudo apt autoremove
echo "==========================="
echo "System update complete"
echo "==========================="
echo "==========================="
echo "Starting backup for config files"
echo "==========================="
IS_GIT_AVAILABLE="$(git --version)"
if [[ $IS_GIT_AVAILABLE == *"version"* ]]; then
echo "Git is Available"
else
echo "Git is not installed"
exit 1
fi
# copy list of vs-code extensions that currently installed
code --list-extensions --show-versions > ./vscode-extensions.txt
# copy other dot files
cp $HOME/{.bashrc,.bash_aliases,.bash_functions,.gitconfig,.profile,.bash_logout} .
# Check git status
gs="$(git status | grep -i "modified")"
# echo "${gs}"
# If there is a new change
if [[ $gs == *"modified"* ]]; then
echo "push"
fi
# push to Github
git add .;
git commit -m "New backup `date +'%Y-%m-%d'`";
git push origin main
echo ""
echo "====================================="
echo "Config files backed up SUCCESSFULLY!!"
echo "====================================="
code . && google-chrome
echo "==========================="
echo "Happy Coding"
echo "==========================="