-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunscript.sh
More file actions
executable file
·47 lines (34 loc) · 889 Bytes
/
runscript.sh
File metadata and controls
executable file
·47 lines (34 loc) · 889 Bytes
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
#!/bin/bash
#================================================================
# Extract the complete HTML files
#================================================================
# Get the current parent directory
ARG1=$PWD
# Go to the source directory
cd source_files
# Remove any former folder
rm -rf localhost:4000
rm -rf _site/localhost:4000
# Clean any previous built files
bundle exec jekyll clean
# Create a command list to run the server in a secondary terminal
cat <<EOF > server.command
pwd
cd $ARG1/source_files
bundle exec jekyll serve
EOF
chmod +x server.command; open server.command
# Sleep the process
sleep 10
# Get the local website
wget -m -p -E -k http://localhost:4000
# Access the folder
cd localhost:4000
# Move all files to the parent directory
cp -r * $ARG1
# Remove and clean folder
cd ..
rm server.command
# Clear terminal
cd $ARG1
clear