From 987daa40bb422af7628bb19a890ff62daf7ae576 Mon Sep 17 00:00:00 2001 From: BlackAsLight <44320105+BlackAsLight@users.noreply.github.com> Date: Sun, 13 Oct 2024 17:59:30 +1100 Subject: [PATCH] docs(tar): fix potential bug --- 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 6a2734d7d335..55a36e956856 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 bdfdde31bbeb..308776b572b8 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); * } * ```