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
App::build()
.add_plugin(ScheduleRunnerPlugin::run_loop(Duration::from_secs_f64(1.0 / 60.0)))
.add_system(hello_world_system.system())
.add_plugin(ScheduleRunnerPlugin::run_loop(Duration::from_secs_f64(
1.0 / 60.0,
)))
.add_system(some_other_system.system())
.run();
}
fn hello_world_system() {
println!("hello world");
}
fn some_other_system() {}

View file

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