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
This commit is contained in:
parent
ddeda0b62e
commit
f08b14c9d0
|
@ -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…
Reference in a new issue