Sha256: 104e66cca81d0318d9b9df96fdaa5a807d20aa98064efbaa57511d8902ea719f

Contents?: true

Size: 1004 Bytes

Versions: 9

Compression:

Stored size: 1004 Bytes

Contents

#!/usr/bin/perl -w

use File::Spec;

my @args = ();

foreach my $arg (@ARGV) {
    if ($arg =~ /^-/) { # arg is a flag
        push @args, $arg;

        # check if next arg should expand (these are file inputs)
        if ($arg eq "-c" || $arg eq "--color-map" ||
            $arg eq "-i" || $arg eq "--biom" ||
            $arg eq "-f" || $arg eq "--infile" ||
            $arg eq "-o" || $arg eq "--outfile" ||
            $arg eq "-n" || $arg eq "--name-map") {

            $expand = 1;
        } else {
            $expand = 0;
        }
    } elsif ($expand) { # an arg that is a path, expand it
        my $path = File::Spec->rel2abs($arg);

        push @args, $path;
    } else { # an arg that is not a path and not a flag
        push @args, $arg;
    }
}

my $img = "mooreryan/iroki";
my $pull = "docker pull $img";
my $run = "docker run -v \"\$HOME:\$HOME\" $img @args";

print "\n\n\nRUNNING COMMAND: $pull\n\n\n";
system("$pull");

print "\n\n\nRUNNING COMMAND: $run\n\n\n";
exec("$run");

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
iroki-0.0.36 bin/iroki_docker
iroki-0.0.35 bin/iroki_docker
iroki-0.0.34 bin/iroki_docker
iroki-0.0.33 bin/iroki_docker
iroki-0.0.32 bin/iroki_docker
iroki-0.0.31 bin/iroki_docker
iroki-0.0.30 bin/iroki_docker
iroki-0.0.29 bin/iroki_docker
iroki-0.0.28 bin/iroki_docker