Chandra
view release on metacpan or search on metacpan
include/chandra/chandra_store.h view on Meta::CPAN
home = getenv("USERPROFILE");
}
if (!home || !*home) {
home = getenv("APPDATA");
}
if (!home || !*home) {
home = "C:\\\\";
}
#else
if (!home || !*home) {
/* Fall back to getpwuid */
struct passwd *pw = getpwuid(getuid());
home = pw ? pw->pw_dir : "/tmp";
}
#endif
path_sv = newSVpvf("%s/.chandra/%s/store.json", home, name);
return path_sv;
}
#endif /* CHANDRA_XS_IMPLEMENTATION */
#endif /* CHANDRA_STORE_H */
lib/Chandra/Pack.pm view on Meta::CPAN
if (delete $args{save}) {
_save_config();
}
return $class;
}
sub _config_file {
my $home = $ENV{HOME};
if (!$home && $^O ne 'MSWin32') {
$home = (getpwuid($<))[7];
}
$home ||= $ENV{USERPROFILE} || '.';
return file_join($home, '.chandra', 'pack.conf');
}
sub _load_config {
my $file = _config_file();
return unless file_is_file($file);
my $content = file_slurp($file);
for my $line (split /\n/, $content) {
( run in 0.965 second using v1.01-cache-2.11-cpan-995e09ba956 )