forked from security-alliance/frameworks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvercel_build.sh
More file actions
executable file
·40 lines (31 loc) · 1.19 KB
/
vercel_build.sh
File metadata and controls
executable file
·40 lines (31 loc) · 1.19 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
#!/bin/bash
set -e # Exit immediately if a command fails
# Create a bin directory
mkdir -p bin
# Download and extract mdBook
echo "Downloading mdBook v0.4.40..."
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
# Install Rust (needed for the prebuild script)
echo "Installing Rust..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
# Download mdbook-admonish directly from GitHub releases
echo "Downloading mdbook-admonish v1.19.0..."
# Check the exact names of the files in the release
curl -sSL https://github.com/tommilligan/mdbook-admonish/releases/download/v1.19.0/mdbook-admonish-v1.19.0-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin/
# Make the binaries executable
chmod +x bin/mdbook
chmod +x bin/mdbook-admonish
# Add the bin directory to PATH
export PATH="$PWD/bin:$PATH"
# Verify the binaries are in PATH
echo "Verifying binaries..."
which mdbook
which mdbook-admonish
# Run the prebuild script
echo "Running prebuild script..."
chmod +x prebuild.sh
./prebuild.sh
# Build the book
echo "Building the book..."
bin/mdbook build -d "book/"