From 825f31160f599992dbdb82a8de48b991b10ff8bc Mon Sep 17 00:00:00 2001 From: Doctor <44320105+BlackAsLight@users.noreply.github.com> Date: Wed, 16 Oct 2024 14:06:55 +1100 Subject: [PATCH] docs(tar): fix example in creating directories (#6113) --- tar/mod.ts | 2 +- tar/untar_stream.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tar/mod.ts b/tar/mod.ts index 6a2734d7d..55a36e956 100644 --- a/tar/mod.ts +++ b/tar/mod.ts @@ -16,7 +16,7 @@ * .pipeThrough(new UntarStream()) * ) { * 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); * } * ``` diff --git a/tar/untar_stream.ts b/tar/untar_stream.ts index bdfdde31b..308776b57 100644 --- a/tar/untar_stream.ts +++ b/tar/untar_stream.ts @@ -167,7 +167,7 @@ export interface TarStreamEntry { * .pipeThrough(new UntarStream()) * ) { * 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); * } * ``` @@ -359,7 +359,7 @@ export class UntarStream * .pipeThrough(new UntarStream()) * ) { * 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); * } * ```