Skip to content

Instantly share code, notes, and snippets.

@ronaldxs
Forked from niner/module-source.pl
Last active December 15, 2016 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ronaldxs/0311813323e2465321dd27d4eda286af to your computer and use it in GitHub Desktop.
Save ronaldxs/0311813323e2465321dd27d4eda286af to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl6
use v6.c;
sub MAIN(Str $module) {
my $cu = $*REPO.need(CompUnit::DependencySpecification.new(:short-name($module)));
say "Dist: " ~ $cu.repo.prefix.child('dist/' ~ $cu.distribution.dist-id);
say "Source: " ~ $cu.repo.prefix.child('sources/' ~ $cu.distribution.meta<provides>{$module}.values[0]<file>);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment