hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/gils/tree.rv
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-10-11 02:16:56 +0200
committerhachem <im@hachem.wtf>2026-10-11 02:16:56 +0200
commit59794d0b999e544a94230d9562bf2b99d2ed74c7 (patch)
treea001db5b5ebb9453d6a0e96f56b36e6ec3ccdd51 /gils/tree.rv
parent88750ed7132c08bcfb24e878c893ef7185c3c0b0 (diff)
feat: actual real vfs, not a faked one lmao
Diffstat (limited to 'gils/tree.rv')
-rw-r--r--gils/tree.rv12
1 files changed, 2 insertions, 10 deletions
diff --git a/gils/tree.rv b/gils/tree.rv
index d146403..4aad0df 100644
--- a/gils/tree.rv
+++ b/gils/tree.rv
@@ -1,7 +1,7 @@
# recursive directory listing
fn tree_walk(path, prefix) do
- const items = fs:entries(path)
+ const items = vfs:entries(path)
if (items == :nil)
return :nil
@@ -29,17 +29,9 @@ end
const context = env.ctx
const target = if (context.argv:len() > 1) expand_path(context.argv[1]) else wd.path
-if vfs_owns(target) and target != "/" do
- fail("tree: #{target}: virtual dir\n")
-end else if target != "/" and fs:is_dir(target) == :false do
+if vfs:is_dir(target) == :false do
fail("tree: #{target}: not a directory\n")
end else do
puts("#{target}\n")
tree_walk(target, "")
- # /proc is the one thing not on disk so tack it on at root
- if target == "/" do
- puts("`-- proc/\n")
- puts(" |-- uptime\n")
- puts(" `-- meminfo\n")
- end
end