Skip to content

Commit

Permalink
dump - iterate
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmarkclements committed Jul 25, 2024
1 parent 5274c21 commit 4ee3d1e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions subsystems/sidecar/ops/dump.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ module.exports = class Dump extends Opstream {
if (dir === '-') {
const pathname = prefix === '/' ? '' : prefix
const entry = pathname === '' ? null : await src.entry(pathname)
console.log(parsed.pathname, prefix, entry)
if (entry === null) {
for await (const file of src.readdir(pathname)) {
const subpath = pathname + '/' + file
const value = await src.get(subpath)
this.push({ tag: 'file', data: { key: subpath, value } })
for await (const entry of src.list(pathname)) {
const value = await src.get(entry)
this.push({ tag: 'file', data: { key: entry.key, value } })
}
} else {
console.log('ah yeah', entry)
}
return
}
Expand Down

0 comments on commit 4ee3d1e

Please sign in to comment.