CNA: replace make-dir with core recursive mkdir (#15006)
Fix #14902 I created a separated helper that wraps `fs.promises.mkdir` and sets `recursive` option to `true` by default. I'm not sure if this is the right approach (maybe it should just call `fs.promises.mkdir` from `create-app.ts`?), any thoughts?
This commit is contained in:
parent
a1f7186658
commit
f4f6fea71f
4 changed files with 9 additions and 8 deletions
|
@ -3,7 +3,6 @@ import retry from 'async-retry'
|
|||
import chalk from 'chalk'
|
||||
import cpy from 'cpy'
|
||||
import fs from 'fs'
|
||||
import makeDir from 'make-dir'
|
||||
import os from 'os'
|
||||
import path from 'path'
|
||||
import {
|
||||
|
@ -14,6 +13,7 @@ import {
|
|||
hasRepo,
|
||||
RepoInfo,
|
||||
} from './helpers/examples'
|
||||
import { makeDir } from './helpers/make-dir'
|
||||
import { tryGitInit } from './helpers/git'
|
||||
import { install } from './helpers/install'
|
||||
import { isFolderEmpty } from './helpers/is-folder-empty'
|
||||
|
|
8
packages/create-next-app/helpers/make-dir.ts
Normal file
8
packages/create-next-app/helpers/make-dir.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
import fs from 'fs'
|
||||
|
||||
export function makeDir(
|
||||
root: string,
|
||||
options = { recursive: true }
|
||||
): Promise<void> {
|
||||
return fs.promises.mkdir(root, options)
|
||||
}
|
|
@ -40,7 +40,6 @@
|
|||
"cpy": "7.3.0",
|
||||
"cross-spawn": "6.0.5",
|
||||
"got": "10.7.0",
|
||||
"make-dir": "3.0.0",
|
||||
"prompts": "2.1.0",
|
||||
"rimraf": "3.0.0",
|
||||
"tar": "4.4.10",
|
||||
|
|
|
@ -10153,12 +10153,6 @@ magic-string@^0.25.2, magic-string@^0.25.3:
|
|||
dependencies:
|
||||
sourcemap-codec "^1.4.4"
|
||||
|
||||
make-dir@3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.0.0.tgz#1b5f39f6b9270ed33f9f054c5c0f84304989f801"
|
||||
dependencies:
|
||||
semver "^6.0.0"
|
||||
|
||||
make-dir@^1.0.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c"
|
||||
|
|
Loading…
Reference in a new issue