| 1 | package Luv::CLI::Command::Update; | ||
| 2 | |||
| 3 | # ABSTRACT: refresh the local library registry cache | ||
| 4 | |||
| 5 | 1 | ▶ | use v5.38; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 1 | ▶ | use App::Cmd::Setup -command; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 1 | ▶ | use File::HomeDir; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 1 | ▶ | use Luv::CLI::Registry; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 0 | ▶ | sub abstract {"Refreshes the local library registry cache."} |
|
Subroutine
abstract: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 13 | |||
| 14 | 0 | ▶ | sub execute ( $self, $opt, $args ) { |
|
Subroutine
execute: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 15 | 0 | my $cache_path = File::HomeDir->my_home . '/.cache/luv/registry.json'; | |
| 16 | 0 | my $registry = Luv::CLI::Registry->new( cache_path => $cache_path ); | |
| 17 | |||
| 18 | 0 | my $count = $registry->refresh; | |
| 19 | 0 | print "Registry updated: $count libraries indexed\n"; | |
| 20 | 0 | return; | |
| 21 | } | ||
| 22 | |||
| 23 | 1 | 1; | |
| 24 | |||
| 25 | __END__ | ||