-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
executable file
·35 lines (30 loc) · 847 Bytes
/
run
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
#!/usr/bin/env ruby
# Run the website project
# This script checks if all the dependencies are installed, and installes them if they're not
def command?(name)
`command -v #{name}`
$?.success?
end
def check_dependencies
puts "Checking dependencies"
# Bundler
if !command? "bundle"
puts "Bundler not found, installing (we'll only do this once)"
system("sudo gem install bundler -n /usr/local/bin")
end
# Bundle
`bundle check`
if !$?.success?
puts "Installing required Rubygems (we'll only do this once)"
system("bundle install --quiet --clean --jobs=4 --path _vendor")
end
puts "✅ Dependencies ok"
end
def build
puts "Building the site"
system("bundle exec jekyll clean")
system("bundle exec jekyll liveserve --watch --config _config.yml,_config_dev.yml")
end
#--open-url
check_dependencies
build