Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 7922e91b8a
Fetching contributors…

Cannot retrieve contributors at this time

executable file 52 lines (46 sloc) 0.82 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
#!/usr/bin/perl

use strict;
use warnings;

my @opts;
while( $_ = $ARGV[0], /^-/ ) {
    shift;
    last if /^--$/;
    push @opts, $_;
}

my $platform = shift;

use Cwd;
my $top = getcwd;
my $fudge;

TOP:
while ($top) {
    for ("$top/fudge",
"$top/spec/fudge",
"$top/t/spec/fudge",
"$top/perl6/t/spec/fudge",
"$top/languages/perl6/t/spec/fudge",
    ) {
if (-f $_) {
$fudge = $_;
last TOP;
}
    }
    $top =~ s!(.*)/(.*)!!;
}
if (not $fudge) {
    for (split(/[:;]/, $ENV{PATH})) {
if (-f "$_/fudge") {
$fudge = "$_/fudge";
last;
}
    }
}

print join(' ',
    map {
        my $pick;
        if ( $_ !~ m/\.$platform$/ ) {
            my $cmd = "$^X \"$fudge\" @opts $platform $_";
            chomp( $pick = `$cmd` );
        }
        defined $pick ? $pick : ();
    } @ARGV
), "\n";
Something went wrong with that request. Please try again.