Get BioConda last version
To detect the latest version provided via Miniconda one can make use of the REST APIs.
The following script will print to the standard output the latest version of a package, by default lookin in the bioconda channel.
#!/usr/bin/env perl
use 5.012;
use File::Basename;
my $anacondaUri = 'https://api.anaconda.org/package';
my $script = basename($0);
my ($package, $channel) = @ARGV;
die "USAGE: $script package-name [conda-channel]\n"
unless ($package);
$channel = 'bioconda' unless ($channel);
my $output = `curl --silent -X GET --header 'Accept: application/json' '$anacondaUri/$channel/$package'| grep latest_version | cut -f4 -d\\"`;
if ($?) {
die "ERROR:\nBad response from curl.\n";
} else {
print $output;
}
Example usage:
perl last_version.pl bwa
0.7.17