[FEATURE] Initial FS traversal
This commit is contained in:
parent
af44ff710f
commit
e66e685903
11 changed files with 1260 additions and 108 deletions
|
@ -25,7 +25,7 @@ const handleError = (e) => {
|
|||
};
|
||||
|
||||
export async function listServerFiles(serverSpec) {
|
||||
const { name } = serverSpec;
|
||||
const { name, dir } = serverSpec;
|
||||
const server = await getServerAssets(name);
|
||||
if (!server)
|
||||
throw new ExpressClientError({
|
||||
|
@ -40,9 +40,12 @@ export async function listServerFiles(serverSpec) {
|
|||
|
||||
// FTP Operations;
|
||||
const client = await useFtp(server.service).catch(handleError);
|
||||
await client
|
||||
.list()
|
||||
.then((f) => res.json(f))
|
||||
const files = client
|
||||
.list(dir)
|
||||
.then((f) => {
|
||||
client.close();
|
||||
return f;
|
||||
})
|
||||
.catch(handleError);
|
||||
client.close();
|
||||
return files;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue