Skip to content

Commit 975de33

Browse files
committed
feat: local copies of the js/css deps to enable sandboxed builds
Signed-off-by: James McCorrie <james.mccorrie@lowrisc.org>
1 parent 81f2d54 commit 975de33

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

scripts/update_js.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
3+
# Find the Git repository root directory
4+
GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
5+
6+
if [ -z "$GIT_ROOT" ]; then
7+
echo "Error: This script must be run from within a Git repository."
8+
exit 1
9+
fi
10+
11+
# Define the target directory relative to the Git root
12+
TARGET_DIR="$GIT_ROOT/src/dvsim/templates/static"
13+
14+
# Create the directory (and any missing parents) if it doesn't exist
15+
mkdir -p "$TARGET_DIR/css" "$TARGET_DIR/js"
16+
echo "Downloading latest Bootstrap and htmx to $TARGET_DIR..."
17+
18+
# Bootstrap CSS (latest 5.x)
19+
curl -L -o "$TARGET_DIR/css/bootstrap.min.css" \
20+
https://cdn.jsdelivr.net/npm/bootstrap@5/dist/css/bootstrap.min.css
21+
22+
# Bootstrap JS Bundle (includes Popper, latest 5.x)
23+
curl -L -o "$TARGET_DIR/js/bootstrap.bundle.min.js" \
24+
https://cdn.jsdelivr.net/npm/bootstrap@5/dist/js/bootstrap.bundle.min.js
25+
26+
# htmx (latest version via @latest tag)
27+
curl -L -o "$TARGET_DIR/js/htmx.min.js" \
28+
https://cdn.jsdelivr.net/npm/htmx.org@latest/dist/htmx.min.js
29+
30+
echo "Done! Files saved to:"
31+
echo " - $TARGET_DIR/css/bootstrap.min.css"
32+
echo " - $TARGET_DIR/js/bootstrap.bundle.min.js"
33+
echo " - $TARGET_DIR/js/htmx.min.js"

src/dvsim/templates/static/css/bootstrap.min.css

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/dvsim/templates/static/js/bootstrap.bundle.min.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/dvsim/templates/static/js/htmx.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)