From dd90a27fb9d74bf71738550c998ec77c9a4aa3b6 Mon Sep 17 00:00:00 2001 From: rafapaezbas <15270736+rafapaezbas@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:10:33 +0200 Subject: [PATCH] skip force check on piped dump (#389) --- subsystems/sidecar/ops/dump.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/subsystems/sidecar/ops/dump.js b/subsystems/sidecar/ops/dump.js index 2fae595a0..32dd9eaca 100644 --- a/subsystems/sidecar/ops/dump.js +++ b/subsystems/sidecar/ops/dump.js @@ -17,9 +17,11 @@ module.exports = class Dump extends Opstream { const { session, sidecar } = this await sidecar.ready() - const files = await fsp.readdir(dir) - const empty = files.length === 0 - if (empty === false && !force) throw new ERR_DIR_NONEMPTY('Dir is not empty. To overwrite: --force') + if (dir !== '-') { + const files = await fsp.readdir(dir) + const empty = files.length === 0 + if (empty === false && !force) throw new ERR_DIR_NONEMPTY('Dir is not empty. To overwrite: --force') + } const parsed = parseLink(link) const isFileLink = parsed.protocol === 'file:'