diff options
author | Ian-Woo Kim <ianwookim@gmail.com> | 2014-02-14T22·44-0800 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-02-26T12·42+0100 |
commit | 8a02fdc38ef5d02115d152a2d3e79ebd8a462e3e (patch) | |
tree | ac6dfab69a0ea473188e4cb70060cc521dee1ddd /scripts/nix-channel.in | |
parent | dcaea042fc895667bf6f529471ff9f449629774c (diff) |
use USER environmental variable if getting user id by getpwuid is failed in perl scripts: download-from-binary-cache.pl and nix-channel
Diffstat (limited to 'scripts/nix-channel.in')
-rwxr-xr-x | scripts/nix-channel.in | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/nix-channel.in b/scripts/nix-channel.in index 4a480ae28b04..db1ca2993777 100755 --- a/scripts/nix-channel.in +++ b/scripts/nix-channel.in @@ -22,7 +22,7 @@ my $channelsList = "$home/.nix-channels"; my $nixDefExpr = "$home/.nix-defexpr"; # Figure out the name of the channels profile. -my $userName = getpwuid($<) or die "cannot figure out user name"; +my $userName = getpwuid($<) or $ENV{"USER"} or die "cannot figure out user name"); my $profile = "$Nix::Config::stateDir/profiles/per-user/$userName/channels"; mkpath(dirname $profile, 0, 0755); |