diff --git a/build_web.sh b/build_web.sh index c078df5..61510a8 100755 --- a/build_web.sh +++ b/build_web.sh @@ -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" @@ -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 diff --git a/start_server.sh b/start_server.sh index 85c3240..d7500f1 100755 --- a/start_server.sh +++ b/start_server.sh @@ -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)