Skip to content

Commit

Permalink
skip force check on piped dump (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafapaezbas authored Oct 22, 2024
1 parent e531e7a commit dd90a27
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions subsystems/sidecar/ops/dump.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:'
Expand Down

0 comments on commit dd90a27

Please sign in to comment.