Skip to content

Commit 4ac5c75

Browse files
committed
chore: simplified streaming paths to handler
[ci skip]
1 parent 6f34a77 commit 4ac5c75

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

src/secrets/CommandMkdir.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,14 @@ class CommandMkdir extends CommandPolykey {
6565
const writer = response.writable.getWriter();
6666
let first = true;
6767
for (const [vault, path] of secretPaths) {
68-
if (first) {
69-
first = false;
70-
await writer.write({
71-
nameOrId: vault,
72-
dirName: path,
73-
metadata: {
74-
...auth,
75-
options: { recursive: options.recursive },
76-
},
77-
});
78-
} else {
79-
await writer.write({ nameOrId: vault, dirName: path });
80-
}
68+
await writer.write({
69+
nameOrId: vault,
70+
dirName: path,
71+
metadata: first
72+
? { ...auth, options: { recursive: options.recursive } }
73+
: undefined,
74+
});
75+
first = false;
8176
}
8277
await writer.close();
8378
return response;

0 commit comments

Comments
 (0)