ls should not load remote data

This commit is contained in:
Lisa Milne 2023-11-11 17:45:31 +10:00
parent d0ebf7eaaf
commit 26d3686e2b
2 changed files with 9 additions and 2 deletions

View file

@ -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;

View file

@ -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
};