Skip to content

Commit

Permalink
ci: mkdir always.
Browse files Browse the repository at this point in the history
  • Loading branch information
knightedcodemonkey committed Jul 1, 2024
1 parent e5bfc29 commit 318ed43
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/duel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -151,13 +151,16 @@ 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) {
if (err.code === 'ENOENT') {
await mkdir(dir, { recursive: true })
}
}
*/

return copyFile(file, dest)
}
Expand Down

0 comments on commit 318ed43

Please sign in to comment.