-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtree_utils.sh
More file actions
45 lines (39 loc) · 844 Bytes
/
Copy pathtree_utils.sh
File metadata and controls
45 lines (39 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
tree.() {
tree -a --gitignore -I '.git' -F --noreport --dirsfirst "$@"
return $?
}
tree.paths() {
tree. -i -f "$@"
return $?
}
tree.paths.d() {
tree.paths -d "$@"
return $?
}
tree.json() {
tree. -J "$@" | jq
return $?
}
tree.yaml() {
tree.json "$@" | yq --input-format json
return $?
}
# tree.meta() {
# # TODO: Read per-directory $dir/.meta annotations, print inline with tree output.
# # $dir/.meta format (tab-separated):
# # . This dir's description
# # subdir subdir description
# # file file description
# tree. "$@"
# return $?
# }
#
# tree.sim() {
# local opts # all proper `tree` options
# # TODO: Process options
# local pathexpan # should be the last option from all passed params
# # Example H1/H2/F{1..3}.ext
# tree $opts --fromfile <(printf "%s\n" "${pathexpan}")
# return $?
# }