| 1 | #! /usr/bin/env perl | ||
| 2 | |||
| 3 | use File::Find; | ||
| 4 | use Cwd; | ||
| 5 | |||
| 6 | my $root = getcwd(); | ||
| 7 | |||
| 8 | if ($^O =~ 'MSWin'){ | ||
| 9 | find( { wanted => \&wanted, no_chdir => 1 } , 'examples/'); | ||
| 10 | } else { | ||
| 11 | my $cmd = "cd examples && strun --recurse --purge-cache --format default"; | ||
| 12 | (system($cmd) == 0) or die "$cmd failed"; | ||
| 13 | } | ||
| 14 | |||
| 15 | sub wanted { | ||
| 16 | |||
| 17 | return unless /story\.(pl|rb|bash|py|pm)$/ or /meta\.txt$/; | ||
| 18 | |||
| 19 | return if /modules\//; | ||
| 20 | |||
| 21 | return unless ( -e $File::Find::dir."\\windows.test" or $File::Find::dir =~/windows/ ); | ||
| 22 | |||
| 23 | (my $dir = $File::Find::dir)=~s{examples/}{}; | ||
| 24 | |||
| 25 | my $cmd = "cd examples && strun --purge-cache --story $dir --format production"; | ||
| 26 | |||
| 27 | (system($cmd) == 0) or die "$cmd failed"; | ||
| 28 | |||
| 29 | } | ||
| 30 | |||
| 31 |