forked from olin-electric-motorsports/AdvancedResearch
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathquick-setup.sh
executable file
·87 lines (71 loc) · 2.44 KB
/
quick-setup.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
set -u
# Colors
red=$(printf '\033[0;31m')
green=$(printf '\033[0;32m')
blue=$(printf '\033[34m')
white=$(printf '\033[97m')
bold=$(printf '\033[1m')
cl=$(printf '\033[0m')
confirm_and_run() {
cmd=$1
read -p "${white}Run ${green}${cmd}${white}? [y/n] " -n 1 -r resp
printf "\n"
case $resp in
[yY][eE][sS]|[yY])
printf "\n${green}Running: ${blue}${bold}$1${cl}\n"
eval $1
;;
[nN][oO]|[nN])
printf "${red}${bold}Skipping ${green}$1${cl}\n"
;;
*)
echo "Invalid input...\n"
exit 1
;;
esac
}
main () {
printf "\n${bold}Welcome to the Formula quick setup!${cl}\n"
printf "You should be running this in your Formula folder, i.e. /home/${USER}/Documents/Formula/\n"
#######
# GIT #
#######
printf "\n"
printf "${green}${bold}Installing Git...${cl}\n"
confirm_and_run "sudo apt update && sudo apt install git"
eval "git --version"
confirm_and_run "sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 && \
sudo apt-add-repository https://cli.github.com/packages \
sudo apt update \
sudo apt install gh"
#########
# KICAD #
#########
printf "\n"
printf "${green}${bold}Installing KiCad...${cl}\n"
confirm_and_run "sudo add-apt-repository --yes ppa:kicad/kicad-5.1-releases && sudo apt update && sudo apt install --install-recommends kicad"
#############
# TOOLCHAIN #
#############
printf "\n"
printf "\n${green}${bold}Installing buildchain...${cl}\n"
confirm_and_run "sudo apt-get install build-essential manpages-dev gcc avr-gcc avrdude"
########
# ZOOM #
########
printf "\n"
printf "\n${green}${bold}Installing Zooooooooooom...${cl}\n"
confirm_and_run "curl -L https://zoom.us/client/latest/zoom_amd64.deb > ~/Downloads/zoom_amd64.deb && sudo dpkg -i ~/Downloads/zoom_amd64.deb"
# FINAL MESSAGE
cat << EOF
Your environment should now be setup. Here are a few things you may want to do now:
******************************************************************
*** https://github.com/OlinElectricMotorSports/AdvancedResearch ***
******************************************************************
* ${bold}Fork the Advanced Research GitHub repository ^^^${cl} (create your own copy of it on GitHub)
* ${bold}Clone your forked repository: ${cl}${green}git clone https://github.com/<YOUR_GITHUB_USERNAME>/AdvancedElectrical.git${cl}
* This copies the repository (all the code and files) to your computer
EOF
}
main