fix showcase script

This commit is contained in:
Carter Anderson 2020-05-01 13:55:07 -07:00
parent 7b79b3de8d
commit fd97bb7bc7
2 changed files with 14 additions and 13 deletions

View file

@ -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() {}

View file

@ -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='/'
read -ra ADDR <<< $entry
IFS=' '
example_file="${ADDR[1]}"
if [ ${example_file: -2} == "rs" ]
then
example="${example_file::-3}"
echo "Running example: $example" echo "Running example: $example"
run_example $example run_example $example
fi
done done