-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtester.sh
More file actions
67 lines (52 loc) · 1.31 KB
/
tester.sh
File metadata and controls
67 lines (52 loc) · 1.31 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
#!/usr/bin/env bash
#colors
red=`tput setaf 1`
green=`tput setaf 2`
yellow=`tput setaf 3`
reset=`tput sgr0`
echo "${green} _____ __ _____ _____"
echo "| | | | | | __|"
echo "| --| |__| | | | |"
echo "|_____|_____|_____|_____|${reset}"
echo "${yellow}Exporting path${reset}"
rversion=`ruby --version | awk {'print substr($2, 0, 3)'}`
case "$rversion" in
2.2)
echo "2.2.0 path set"
export PATH=~/.gem/ruby/2.2.0/bin:$PATH
;;
1.9)
echo "1.9 path set"
export PATH=~/.gem/ruby/1.9.0/bin:$PATH
;;
*)
echo {$rversion}
;;
esac
echo "${yellow}Checking Dependencies${reset}"
if [ -f ~/.gem/ruby/2.2.0/bin/bundler ]
then
echo "${green}Found Bundler${reset}"
elif [ -f ~/.gem/ruby/1.9.0/bin/bundler ]
then
echo "${green}Found Bundler${reset}"
else
echo "${red}Installing Bundler${reset}"
gem install bundler --user-install
fi
echo "${yellow}Checking Dependencies${reset}"
if [ -d vendor ]
then
echo "${green}Found vendor folder${reset}"
else
echo "${red}Installing Dependencies${reset}"
bundle install --path vendor
fi
echo "${green}Opening Browser Tab...${reset}"
xdg-open http://0.0.0.0:4000 &
echo "${yellow}You Will Need To Refresh Your Browser After The Server Starts${reset}"
echo "${green}Statring Jekyll${reset}"
notify-send "Starting Server"
bundle exec jekyll serve
echo "Bye!"
exit