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