diff --git a/examples/app/headless.rs b/examples/app/headless.rs index cd8cbfae61..49508f1c0a 100644 --- a/examples/app/headless.rs +++ b/examples/app/headless.rs @@ -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() {} diff --git a/tools/example_showcase.sh b/tools/example_showcase.sh index 1514fef2ef..c6d5e66d41 100644 --- a/tools/example_showcase.sh +++ b/tools/example_showcase.sh @@ -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 \ No newline at end of file