From 26d3686e2b24152337a3e61c918a7f11500d7059 Mon Sep 17 00:00:00 2001 From: Lisa Milne Date: Sat, 11 Nov 2023 17:45:31 +1000 Subject: [PATCH] ls should not load remote data --- clite/commands.js | 2 +- clite/core.js | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/clite/commands.js b/clite/commands.js index ed9c411..8067bca 100644 --- a/clite/commands.js +++ b/clite/commands.js @@ -86,7 +86,7 @@ Options: dirs.forEach(function(dir,index) { if (dirs.length > 1) io.write(dir+':'); - var fd = stdio.open(dir); + var fd = stdio.open(dir,false); if (!fd) { io.error('cannot open directory: '+dir); return; diff --git a/clite/core.js b/clite/core.js index 6c0a232..c4bae7e 100644 --- a/clite/core.js +++ b/clite/core.js @@ -1021,7 +1021,7 @@ clite.shell = { include:function(name) { switch (name) { case 'stdlib': - return clite.lib; + return clite.lib.api; break; case 'stdio': return clite.io; @@ -1427,3 +1427,10 @@ clite.lib = { return 0; } } +clite.lib.api = { // this is passed to programs via include('stdlib') + basename:clite.lib.basename, + dirname:clite.lib.dirname, + resolvePath:clite.lib.resolvePath, + getFileType:clite.lib.getFileType, + strToArgs:clite.lib.strToArgs +};