From 318ed432742447c0a33a51203cea9c5546a77a13 Mon Sep 17 00:00:00 2001 From: KCM Date: Mon, 1 Jul 2024 10:28:41 -0500 Subject: [PATCH] ci: mkdir always. --- src/duel.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/duel.js b/src/duel.js index 4bf84bc..1c67410 100755 --- a/src/duel.js +++ b/src/duel.js @@ -3,7 +3,7 @@ import { argv, platform } from 'node:process' import { join, dirname, resolve, relative, parse } from 'node:path' import { spawn } from 'node:child_process' -import { writeFile, rm, rename, mkdir, copyFile, lstat } from 'node:fs/promises' +import { writeFile, rm, rename, mkdir, copyFile } from 'node:fs/promises' import { randomBytes } from 'node:crypto' import { performance } from 'node:perf_hooks' @@ -151,6 +151,8 @@ const duel = async args => { const dest = join(subDir, relative(projectDir, file).replace(/^(\.\.\/)*/, '')) const { dir } = parse(dest) + await mkdir(dir, { recursive: true }) + /* try { await lstat(dir) } catch (err) { @@ -158,6 +160,7 @@ const duel = async args => { await mkdir(dir, { recursive: true }) } } + */ return copyFile(file, dest) }