mirror of
https://github.com/NixOS/nix.git
synced 2025-11-15 06:52:43 +01:00
nix upgrade-nix: Improve error message if 'nix' is not in a profile
E.g.
$ nix upgrade-nix
error: directory '/home/eelco/Dev/nix/inst/bin' does not appear to be part of a Nix profile
instead of
$ nix upgrade-nix
error: '/home/eelco/Dev/nix/inst' is not a symlink
(cherry picked from commit f08b14c9d0)
This commit is contained in:
parent
d7b2c6c92f
commit
f8fbab43f2
1 changed files with 1 additions and 1 deletions
|
|
@ -113,7 +113,7 @@ struct CmdUpgradeNix : MixDryRun, StoreCommand
|
|||
Path profileDir = dirOf(where);
|
||||
|
||||
// Resolve profile to /nix/var/nix/profiles/<name> link.
|
||||
while (baseNameOf(dirOf(canonPath(profileDir))) != "profiles")
|
||||
while (baseNameOf(dirOf(canonPath(profileDir))) != "profiles" && isLink(profileDir))
|
||||
profileDir = readLink(profileDir);
|
||||
|
||||
printInfo("found profile '%s'", profileDir);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue