docs(tar): fix example in creating directories (#6113)

This commit is contained in:
Doctor 2024-10-16 14:06:55 +11:00 committed by GitHub
parent d85d0d8032
commit 825f31160f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@
* .pipeThrough(new UntarStream()) * .pipeThrough(new UntarStream())
* ) { * ) {
* const path = normalize(entry.path); * const path = normalize(entry.path);
* await Deno.mkdir(dirname(path)); * await Deno.mkdir(dirname(path), { recursive: true });
* await entry.readable?.pipeTo((await Deno.create(path)).writable); * await entry.readable?.pipeTo((await Deno.create(path)).writable);
* } * }
* ``` * ```

View File

@ -167,7 +167,7 @@ export interface TarStreamEntry {
* .pipeThrough(new UntarStream()) * .pipeThrough(new UntarStream())
* ) { * ) {
* const path = normalize(entry.path); * const path = normalize(entry.path);
* await Deno.mkdir(dirname(path)); * await Deno.mkdir(dirname(path), { recursive: true });
* await entry.readable?.pipeTo((await Deno.create(path)).writable); * await entry.readable?.pipeTo((await Deno.create(path)).writable);
* } * }
* ``` * ```
@ -359,7 +359,7 @@ export class UntarStream
* .pipeThrough(new UntarStream()) * .pipeThrough(new UntarStream())
* ) { * ) {
* const path = normalize(entry.path); * const path = normalize(entry.path);
* await Deno.mkdir(dirname(path)); * await Deno.mkdir(dirname(path), { recursive: true });
* await entry.readable?.pipeTo((await Deno.create(path)).writable); * await entry.readable?.pipeTo((await Deno.create(path)).writable);
* } * }
* ``` * ```