mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 12:50:04 -04:00
Adapt the URL open command to the platform
With this new version we use $OSTYPE bash env var to query what OS are we running on. - On Linux, ex: Fedora, we use `xdg-open` - On Windows, ex: msys, we use `start` - For other other variants we try to use `open` We should update this script when we notice that `open` is not available on a particular platform.
This commit is contained in:
@@ -32,4 +32,13 @@ wasm-bindgen "target/wasm32-unknown-unknown/$BUILD/$TARGET_NAME" \
|
||||
|
||||
echo "Finished: docs/${CRATE_NAME}.wasm"
|
||||
|
||||
open http://localhost:8888/index.html
|
||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
# Linux, ex: Fedora
|
||||
xdg-open http://localhost:8888/index.html
|
||||
elif [[ "$OSTYPE" == "msys" ]]; then
|
||||
# Windows
|
||||
start http://localhost:8888/index.html
|
||||
else
|
||||
# Darmin aka MacOS or something else
|
||||
open http://localhost:8888/index.html
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user