mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
fix showcase script
This commit is contained in:
parent
7b79b3de8d
commit
fd97bb7bc7
2 changed files with 14 additions and 13 deletions
|
@ -17,11 +17,15 @@ fn main() {
|
||||||
|
|
||||||
// this app loops forever at 60 fps
|
// this app loops forever at 60 fps
|
||||||
App::build()
|
App::build()
|
||||||
.add_plugin(ScheduleRunnerPlugin::run_loop(Duration::from_secs_f64(1.0 / 60.0)))
|
.add_plugin(ScheduleRunnerPlugin::run_loop(Duration::from_secs_f64(
|
||||||
.add_system(hello_world_system.system())
|
1.0 / 60.0,
|
||||||
|
)))
|
||||||
|
.add_system(some_other_system.system())
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn hello_world_system() {
|
fn hello_world_system() {
|
||||||
println!("hello world");
|
println!("hello world");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn some_other_system() {}
|
||||||
|
|
|
@ -6,16 +6,13 @@ run_example() {
|
||||||
timeout "$duration" cargo run --example $1
|
timeout "$duration" cargo run --example $1
|
||||||
}
|
}
|
||||||
|
|
||||||
for entry in examples/*
|
example_list="$(cargo build --example 2>&1)"
|
||||||
|
example_list=${example_list//$'\n'/}
|
||||||
|
example_list="${example_list#error\: \"--example\" takes one argument.Available examples\: }"
|
||||||
|
|
||||||
|
echo $example_list
|
||||||
|
for example in $example_list
|
||||||
do
|
do
|
||||||
IFS='/'
|
echo "Running example: $example"
|
||||||
read -ra ADDR <<< $entry
|
run_example $example
|
||||||
IFS=' '
|
|
||||||
example_file="${ADDR[1]}"
|
|
||||||
if [ ${example_file: -2} == "rs" ]
|
|
||||||
then
|
|
||||||
example="${example_file::-3}"
|
|
||||||
echo "Running example: $example"
|
|
||||||
run_example $example
|
|
||||||
fi
|
|
||||||
done
|
done
|
Loading…
Reference in a new issue