-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetup-local-dev.sh
More file actions
executable file
·57 lines (45 loc) · 1.71 KB
/
setup-local-dev.sh
File metadata and controls
executable file
·57 lines (45 loc) · 1.71 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
#!/bin/bash
# Script to set up local development environment for the website
# Colors for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e "${YELLOW}Setting up local development environment...${NC}"
# Add Homebrew Ruby to PATH
echo -e "${YELLOW}Adding Homebrew Ruby to PATH...${NC}"
export PATH="/opt/homebrew/opt/ruby/bin:$PATH"
# Check Ruby version
echo -e "${YELLOW}Checking Ruby version...${NC}"
ruby_version=$(ruby -v)
echo -e "Ruby version: ${GREEN}$ruby_version${NC}"
# Check if Ruby is from Homebrew
which_ruby=$(which ruby)
if [[ $which_ruby == *"/opt/homebrew/opt/ruby/bin/ruby"* ]]; then
echo -e "${GREEN}Using Homebrew Ruby: $which_ruby${NC}"
else
echo -e "${RED}Not using Homebrew Ruby. Current Ruby: $which_ruby${NC}"
echo -e "${YELLOW}Please make sure Homebrew Ruby is installed:${NC}"
echo -e " brew install ruby"
echo -e "${YELLOW}Then add the following to your shell profile (.zshrc, .bash_profile, etc.):${NC}"
echo -e " export PATH=\"/opt/homebrew/opt/ruby/bin:\$PATH\""
exit 1
fi
# Update RubyGems
echo -e "${YELLOW}Updating RubyGems...${NC}"
gem update --system
# Install Bundler
echo -e "${YELLOW}Installing latest Bundler...${NC}"
gem install bundler
# Install dependencies
echo -e "${YELLOW}Installing dependencies...${NC}"
cd www
bundle update --bundler
bundle install
echo -e "\n${GREEN}Setup complete!${NC}"
echo -e "${YELLOW}To run the site locally:${NC}"
echo -e " cd www"
echo -e " bundle exec jekyll serve"
echo -e "\n${YELLOW}To make this setup permanent, add the following to your shell profile (.zshrc, .bash_profile, etc.):${NC}"
echo -e " export PATH=\"/opt/homebrew/opt/ruby/bin:\$PATH\""
echo -e "\n${GREEN}Done!${NC}"