.lib/perl5/Autofetch.pm

changeset 852
cf73e0ff4258
parent 690
d005acd0e883
equal deleted inserted replaced
851:b8501cb649b6 852:cf73e0ff4258
4 use warnings; 4 use warnings;
5 use File::Spec::Functions qw(catfile rel2abs); 5 use File::Spec::Functions qw(catfile rel2abs);
6 6
7 sub fetch { 7 sub fetch {
8 my ($path, $module) = @_; 8 my ($path, $module) = @_;
9 return if
10 system('cpm', 'install', -L => $path, $module) == 0;
9 system 'cpanm', -nq, -l => $path, $module; 11 system 'cpanm', -nq, -l => $path, $module;
10 } 12 }
11 13
12 sub cachepath { 14 sub cachepath {
13 catfile(glob('~'), '.cache', 'lib', rel2abs($_[0]) =~ y|/ |-_|r); 15 catfile(glob('~'), '.cache', 'lib', rel2abs($_[0]) =~ y|/ |-_|r);

mercurial