Unverified Commit 59fe6e0c authored by Philip Taron's avatar Philip Taron Committed by GitHub
Browse files

lib.filesystem: remove Nix 2.14 shim (#450408)

parents e89bffa2 4f652cfa
Loading
Loading
Loading
Loading
+1 −19
Original line number Diff line number Diff line
@@ -56,25 +56,7 @@ in

    :::
  */
  pathType =
    builtins.readFileType or
    # Nix <2.14 compatibility shim
    (
      path:
      if
        !pathExists path
      # Fail irrecoverably to mimic the historic behavior of this function and
      # the new builtins.readFileType
      then
        abort "lib.filesystem.pathType: Path ${toString path} does not exist."
      # The filesystem root is the only path where `dirOf / == /` and
      # `baseNameOf /` is not valid. We can detect this and directly return
      # "directory", since we know the filesystem root can't be anything else.
      else if dirOf path == path then
        "directory"
      else
        (readDir (dirOf path)).${baseNameOf path}
    );
  pathType = builtins.readFileType;

  /**
    Whether a path exists and is a directory.