From ec51666002900faa389ff0c8f34ed32c663bd723 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Sat, 28 Sep 2024 00:38:42 -0400 Subject: Render the UI at /. --- tools/build-ui | 9 +++++++++ tools/run | 1 + 2 files changed, 10 insertions(+) create mode 100755 tools/build-ui (limited to 'tools') diff --git a/tools/build-ui b/tools/build-ui new file mode 100755 index 0000000..a7ed9a5 --- /dev/null +++ b/tools/build-ui @@ -0,0 +1,9 @@ +#!/bin/bash -e + +## tools/build-ui +## +## Builds the Svelte UI. + +cd "$(dirname "$0")/../hi-ui" + +npm run build diff --git a/tools/run b/tools/run index b063eb7..452355e 100755 --- a/tools/run +++ b/tools/run @@ -4,4 +4,5 @@ ## ## Run the server in development mode. Shorthand for `cargo run`. +tools/build-ui cargo run -- "$@" -- cgit v1.2.3 From 40cc35bcc9b881a61ca62c67e107bb17c2748f57 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Thu, 3 Oct 2024 21:23:03 -0400 Subject: Pre-commit needs the UI available, so make it available. --- git-hooks/pre-commit | 2 ++ tools/build-ui | 1 + 2 files changed, 3 insertions(+) (limited to 'tools') diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit index cd2f9ee..cafdb8d 100755 --- a/git-hooks/pre-commit +++ b/git-hooks/pre-commit @@ -4,6 +4,8 @@ # run. It gets old fast. That's why this uses `cargo check` and not `cargo # test`, for example. +# Make sure the UI is up to date. +tools/build-ui # Make sure Cargo.lock is up to date with Cargo.toml. cargo update --locked --workspace # Make sure there are no screamers in the code. diff --git a/tools/build-ui b/tools/build-ui index a7ed9a5..48b83e6 100755 --- a/tools/build-ui +++ b/tools/build-ui @@ -6,4 +6,5 @@ cd "$(dirname "$0")/../hi-ui" +npm install npm run build -- cgit v1.2.3