-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib.path.splitRoot
: init
#244358
lib.path.splitRoot
: init
#244358
Conversation
You know I like parts, but I was kind of expecting this to do the splitting between |
d2acf75
to
137e724
Compare
I like it, applied! |
Split the filesystem root from a path. | ||
The result is an attribute set with these attributes: | ||
|
||
- `root`: The filesystem root of the path, meaning that this directory has no parent directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unfortunate that this concept does not have Nix documentation yet.
(no action required now)
f7aa954
to
9012e2b
Compare
I fixed the bug in nixdoc that removed all indentation: nix-community/nixdoc#62 That was just too annoying when we're trying to have some nice formatting in the docs! |
9012e2b
to
e4d40d3
Compare
=> { root = /.; subpath = "./bar"; } | ||
|
||
splitRoot "/foo/bar" | ||
=> <error> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reader will wonder what's the problem with this? Surely /
is the root.
I think it might be sensible to treat all "${storeDir}/${x}"
as roots, but that's a discussion for another time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That feels like something that should be supported by lib.strings.*
instead. The error could even redirect the user to that
Co-authored-by: Robert Hensing <[email protected]>
Co-authored-by: Robert Hensing <[email protected]>
b84d798
to
d7bf0d7
Compare
I think this is ready to be merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scoping out per-sublibrary and per-type docs.
Not sure what you mean with that, but thanks for the merge :) |
Description of changes
Creates a new function:
lib.path.splitRoot :: Path -> { root :: Path, subpath :: String }
: Split a path into its parts.This is part of the path library effort and needed for the implementation of file set combinators.
This work is sponsored by Antithesis ✨
Things done