Skip to content

Commit

Permalink
try again
Browse files Browse the repository at this point in the history
  • Loading branch information
arcadeperfect committed Nov 27, 2024
1 parent d50672e commit 993589e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion build_wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,13 @@ cargo build --release --target wasm32-unknown-unknown
wasm-bindgen --out-dir ./out/ --target web ./target/wasm32-unknown-unknown/release/bevy_vaporwave.wasm

# sed -i 's/getObject(arg0).focus();/const scrollPos = window.scrollY; getObject(arg0).focus(); window.scrollTo(0, scrollPos);/' ./out/bevy_vaporwave.js
./fix_bindings.sh
# ./fix_bindings.sh

# Detect OS and use appropriate sed command
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
sed -i '' 's/getObject(arg0).focus();/const scrollPos = window.scrollY; getObject(arg0).focus(); window.scrollTo(0, scrollPos);/' ./out/bevy_vaporwave.js
else
# Linux and others
sed -i 's/getObject(arg0).focus();/const scrollPos = window.scrollY; getObject(arg0).focus(); window.scrollTo(0, scrollPos);/' ./out/bevy_vaporwave.js
fi
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// force build again again
// force build again again again

use bevy::gltf::{GltfExtras, GltfSceneExtras};
use bevy::prelude::Color;
Expand Down

0 comments on commit 993589e

Please sign in to comment.