Skip to content

Commit 4299b8d

Browse files
committed
no esnureDir
1 parent d921f30 commit 4299b8d

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/cli/assemblies-create.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ async function myStat(
102102
return await fsp.stat(filepath)
103103
}
104104

105-
async function ensureDir(dir: string): Promise<void> {
106-
await fsp.mkdir(dir, { recursive: true })
107-
}
108-
109105
function dirProvider(output: string): OutstreamProvider {
110106
return async (inpath, indir = process.cwd()) => {
111107
if (inpath == null || inpath === '-') {
@@ -117,7 +113,7 @@ function dirProvider(output: string): OutstreamProvider {
117113
const outpath = path.join(output, relpath)
118114
const outdir = path.dirname(outpath)
119115

120-
await ensureDir(outdir)
116+
await fsp.mkdir(outdir, { recursive: true })
121117
const [, stats] = await tryCatch(fsp.stat(outpath))
122118
const mtime = stats?.mtime ?? new Date(0)
123119
const outstream = fs.createWriteStream(outpath) as OutStream
@@ -130,7 +126,7 @@ function dirProvider(output: string): OutstreamProvider {
130126
}
131127

132128
function fileProvider(output: string): OutstreamProvider {
133-
const dirExistsP = ensureDir(path.dirname(output))
129+
const dirExistsP = fsp.mkdir(path.dirname(output), { recursive: true })
134130
return async (_inpath) => {
135131
await dirExistsP
136132
if (output === '-') return process.stdout as OutStream

0 commit comments

Comments
 (0)