-
Notifications
You must be signed in to change notification settings - Fork 4
/
test.sh
executable file
·71 lines (61 loc) · 2.21 KB
/
test.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
#!/bin/bash
#
# Define colors
color_normal="\x1B[0m"
color_red="\x1B[31m"
color_green="\x1B[32m"
color_yellow="\x1B[33m"
color_blue="\x1B[34m"
color_magenta="\x1B[35m"
color_cyan="\x1B[36m"
color_white="\x1B[37m"
app_folder="/Applications"
echo_color() {
message=$1
color=${2:-$color_normal}
printf "$color$message $color_normal\n"
}
check_file(){
#echo_color "checking file: $2"
if [ ! -z "$2" ]; then
echo_color "checking file: $2"
else
echo_color "checking file: $1"
fi
if [ -e "$1" ]; then
echo_color "File found: $1" $color_green
else
echo_color "File not found: $1" $color_red
exit 1
fi
}
check_program(){
echo_color "checking program: $1"
which -s $1 && echo_color "File found: $1" $color_green || ( echo_color "File not found: $1" $color_red && exit 1 )
}
echo_color "Start test" $color_yellow
cat ~/.zshrc
check_program "zsh" # check that zsh is in $PATH
check_program "brew" # check that brew is in $PATH
check_program "tree" # check that tree is in $PATH
check_program "wget" # check that wget is in $PATH
check_program "convert" # check that imagemagick is in $PATH
check_program "git" # check that git is in $PATH
check_program "python" # check that python is in $PATH
check_program "subl" # check that Sublime Text is in $PATH
check_program "code" # check that VSCode is in $PATH
# check_file $HOME/.zshrc
check_file "$app_folder/iTerm.app" # check iTerm2 software
check_file "$app_folder/Spectacle.app" # check iTerm2 software
check_file "$app_folder/Flycut.app" # check iTerm2 software
#check_file "$app_folder/alfred.app" # check iTerm2 software
check_file "$app_folder/Dropbox.app" # check Dropbox software
# check_file "$app_folder/VirtualBox.app" # check VirtualBox software
# check_file "$app_folder/Slack.app" # check Slack software
check_file "$app_folder/Google Chrome.app" # check Google Chrome software
#check_file "$app_folder/LimeChat.app" # check Lime Chat software
check_file "$app_folder/TeamViewer.app" # check Team Viewer software
check_file "$app_folder/Robo 3T.app" # check Robomongo software
check_program "npm"
grep -qc 'bsync' ~/.gitconfig || ( echo_color "Could not find bsync in gitconfig" && exit 1)
echo_color "End test" $color_yellow