Skip to content

Commit

Permalink
add license to META6.json, fix #15
Browse files Browse the repository at this point in the history
  • Loading branch information
skaji committed Apr 21, 2017
1 parent 9bce964 commit c5ac2b7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions META6.json
Expand Up @@ -10,6 +10,7 @@
"Shell::Command"
],
"description" : "minimal authoring tool for Perl6",
"license" : "Artistic-2.0",
"name" : "App::Mi6",
"perl" : "6.c",
"provides" : {
Expand Down
12 changes: 12 additions & 0 deletions lib/App/Mi6.pm6
Expand Up @@ -159,10 +159,22 @@ method regenerate-meta-info($module, $module-file) {
version => $already<version> || "*",
resources => $already<resources> || [],
tags => $already<tags> || [],
license => $already<license> || guess-license(),
;
($meta-file || "META6.json").IO.spurt: App::Mi6::JSON.encode(%new-meta) ~ "\n";
}

sub guess-license() {
my $file = "LICENSE".IO;
return 'NOASSERTION' unless $file.e;
my @line = $file.lines;
if @line.elems == 201 && @line[0].index('The Artistic License 2.0') {
return 'Artistic-2.0';
} else {
return 'NOASSERTION';
}
}

sub find-description($module-file) {
my $content = $module-file.IO.slurp;
if $content ~~ /^^
Expand Down

0 comments on commit c5ac2b7

Please sign in to comment.