Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement Distro.homedir, preparing for $*HOME
  • Loading branch information
lizmat committed Feb 14, 2015
1 parent 159c38b commit c92e49e
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/core/Distro.pm
Expand Up @@ -39,15 +39,23 @@ class Distro does Systemic {
}

method tmpdir() {
my $ENV := %*ENV;
self!first-rwx-dir(
self.is-win
?? <<
$ENV<TMPDIR> $ENV<TEMP> $ENV<TMP> SYS:/temp C:/system/temp C:/temp /tmp /
>>
!! <<
$ENV<TMPDIR> /tmp
>>
my %ENV := %*ENV;
self!first-rwx-dir( self.is-win
?? <<
%ENV<TMPDIR> %ENV<TEMP> %ENV<TMP> SYS:/temp C:/system/temp C:/temp /tmp /
>>
!! <<
%ENV<TMPDIR> /tmp
>>
);
}

method homedir() {
my %ENV := %*ENV;
my $USER := $*USER.Str;
self!first-rwx-dir( self.is-win
?? << %ENV<HOME> %ENV<HOMEDIR> >>
!! << %ENV<HOME> "/home/$USER" "/Users/$USER" >>
);
}
}
Expand Down

0 comments on commit c92e49e

Please sign in to comment.