Skip to content

Commit

Permalink
Make it easier to adapt some settings for the web
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkazik authored and emilk committed Aug 2, 2022
1 parent eed822c commit 843f250
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions build_web.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env bash
set -eu

CRATE_NAME=${PWD##*/} # assume crate name is the same as the folder name

script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$script_path"

Expand Down Expand Up @@ -30,8 +33,6 @@ done

# ./setup_web.sh # <- call this first!

FOLDER_NAME=${PWD##*/}
CRATE_NAME=$FOLDER_NAME # assume crate name is the same as the folder name
CRATE_NAME_SNAKE_CASE="${CRATE_NAME//-/_}" # for those who name crates with-kebab-case

# This is required to enable the web_sys clipboard API which egui_web uses
Expand Down
8 changes: 5 additions & 3 deletions start_server.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/usr/bin/env bash
set -eu

PORT=8080

# Starts a local web-server that serves the contents of the `doc/` folder,
# which is the folder to where the web version is compiled.

echo "open http://localhost:8080"
echo "open http://localhost:$PORT"

(cd docs && basic-http-server --addr 127.0.0.1:8080 .)
# (cd docs && python3 -m http.server 8080 --bind 127.0.0.1)
(cd docs && basic-http-server --addr 127.0.0.1:$PORT .)
# (cd docs && python3 -m http.server $PORT --bind 127.0.0.1)

0 comments on commit 843f250

Please sign in to comment.