File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
- import { readFile , writeFile } from 'fs/promises '
1
+ import { promises as fs } from 'fs'
2
2
import { fileURLToPath } from 'url'
3
3
4
4
import del from 'del'
@@ -17,7 +17,7 @@ export const cleanRepo = async function () {
17
17
18
18
// Remove `npm run init` in `package.json` and all `devDependencies`.
19
19
const cleanPackageJson = async function ( ) {
20
- const content = await readFile ( PACKAGE_JSON , 'utf8' )
20
+ const content = await fs . readFile ( PACKAGE_JSON , 'utf8' )
21
21
const { scripts, dependencies, devDependencies, ...packageJson } =
22
22
JSON . parse ( content )
23
23
@@ -31,7 +31,7 @@ const cleanPackageJson = async function () {
31
31
}
32
32
33
33
const contentA = JSON . stringify ( packageJsonA , null , 2 )
34
- await writeFile ( PACKAGE_JSON , contentA )
34
+ await fs . writeFile ( PACKAGE_JSON , contentA )
35
35
}
36
36
37
37
// Remove devDependencies used only for initialization
Original file line number Diff line number Diff line change 1
- import { readFile , writeFile } from 'fs/promises '
1
+ import { promises as fs } from 'fs'
2
2
import { fileURLToPath } from 'url'
3
3
4
4
import fastGlob from 'fast-glob'
@@ -19,9 +19,9 @@ const addPackageRoot = function (path) {
19
19
}
20
20
21
21
const applyTemplate = async function ( file , variables ) {
22
- const content = await readFile ( file , 'utf8' )
22
+ const content = await fs . readFile ( file , 'utf8' )
23
23
const contentA = replaceVariables ( content , variables )
24
- await writeFile ( file , contentA )
24
+ await fs . writeFile ( file , contentA )
25
25
}
26
26
27
27
const replaceVariables = function ( content , variables ) {
You can’t perform that action at this time.
0 commit comments