aboutsummaryrefslogtreecommitdiff
path: root/api/paths.yaml
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-05-17 16:04:05 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-05-17 16:04:05 -0400
commit8febea9aebe05644731bb68c297d3d13649a8dcb (patch)
tree4971ccc4415c11745762cbebcbefd06abbfaebec /api/paths.yaml
parent761a483e28935f0bdee4658c37dfaa4606c2660a (diff)
Add Path.sibling()
Diffstat (limited to 'api/paths.yaml')
-rw-r--r--api/paths.yaml24
1 files changed, 23 insertions, 1 deletions
diff --git a/api/paths.yaml b/api/paths.yaml
index 5efae599..40813129 100644
--- a/api/paths.yaml
+++ b/api/paths.yaml
@@ -215,7 +215,7 @@ Path.child:
description: >
Return a path that is a child of another path.
return:
- type: '[Path]'
+ type: 'Path'
description: >
A new path representing the child.
args:
@@ -761,6 +761,28 @@ Path.set_owner:
Whether to follow symbolic links.
example: |
(./file.txt).set_owner(owner="root", group="wheel")
+
+Path.sibling:
+ short: get another path in the same directory
+ description: >
+ Return a path that is a sibling of another path (i.e. has the same parent,
+ but a different name). This is equivalent to `.parent().child(name)`
+ return:
+ type: 'Path'
+ description: >
+ A new path representing the sibling.
+ args:
+ path:
+ type: 'Path'
+ description: >
+ A path.
+ name:
+ type: 'Text'
+ description: >
+ The name of a sibling file or directory.
+ example: |
+ >> (/foo/baz).sibling("doop")
+ = (/foo/doop)
Path.subdirectories:
short: get subdirectories