package NVMPL::Remote;
use strict;
use warnings;
use feature 'say';
use HTTP::Tiny;
use JSON::PP qw(decode_json);
use File::Spec;
use NVMPL::Config;
use NVMPL::Utils qw(log_info log_warn log_error);
my $cachefile = File::Spec->catfile($install_dir, 'node_index_cache.json');
my $ttl = $cfg->{cache_ttl};
my $json_data;
my $use_cache = 0;
if (-f $cachefile) {
my $age =
!";
local $/;
$json_data = <$fh>;
close $fh;
}
}
unless ($use_cache) {
my $url = "$mirror/index.json";
log_info("Fetching remote ve
package NVMPL::Config;
use strict;
use warnings;
use JSON::PP qw(decode_json);
use File::Spec;
use File::HomeDir;
use File::Path qw(make_path);
# Default config locations
my $SYSTEM_CONF = '/etc/nvm-
---------------------------------------------------------------
# Internal helper: read and merge JSON or simple key=value config files
# --------------------------------------------------------------
;
local $/;
my $content = <$fh>;
close $fh;
my $data;
eval { $data = decode_json($content) };
if ($@) {
for my $line (split /\n/, $content) {
next if $lin