-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·41 lines (32 loc) · 788 Bytes
/
build.sh
File metadata and controls
executable file
·41 lines (32 loc) · 788 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
#!/bin/bash
set -e
WEB_CONTENT_DIR="./web/content"
CONTENT_DIR="./content"
WEB_DIR="./web"
# Sanitize /web/content if it exists
if [ -d "$WEB_CONTENT_DIR" ]; then
rm -rf "${WEB_CONTENT_DIR:?}/"*
else
mkdir -p "$WEB_CONTENT_DIR"
fi
# Copy /content folder to /web
cp -r "$CONTENT_DIR/." "$WEB_CONTENT_DIR/"
# Build wasm-pack in /web directory
echo "Building WASM"
(
cd "$WEB_DIR"
wasm-pack build --release --target web
)
echo ""
# Build helper project
echo "Building helper project"
cargo build --release
# Check if olifm-helper exists and remove it
if [ -e ./olifm-helper ]; then
rm ./olifm-helper
fi
# Move the binary
mv ./target/release/olifm-master ./olifm-helper
# Build site map
echo "Building site map"
./olifm-helper --content ./web/content --out ./web